Skip to content

Conversation

@arcanapower
Copy link
Contributor

Some machine features are read only, use target setting flags to check if they are writable.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for Target Setting Flags to the FTMS (Fitness Machine Service) library, enabling the determination of which machine features are writable versus read-only. The implementation introduces a new TargetSettingFlag class with 17 flag definitions and a method to extract these flags from the second 32-bit segment of the machine feature data.

  • Adds TargetSettingFlag class with 17 target setting flags for various fitness machine parameters
  • Implements getTargetSettingFlags() method in MachineFeature to parse target setting flags from bytes 4-7 of the data
  • Exports TargetSettingFlag class in the public API

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
lib/src/ftms/characteristic/machine/feature/target_setting_flag.dart Defines 17 target setting flags representing writable machine features (speed, power, resistance, etc.)
lib/src/ftms/characteristic/machine/feature/machine_feature.dart Adds allTargetSettingFlags getter and getTargetSettingFlags() method to parse flags from the second 4-byte segment
lib/flutter_ftms.dart Exports TargetSettingFlag class to make it available in the public API

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Malte2036
Copy link
Owner

Hey @arcanapower,

can you add a test to machine_feature_test.dart with real ftms data, then i can merge this PR 😁

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.

2 participants