Skip to content

Conversation

@arcanapower
Copy link
Contributor

When I connected to a treadmill machine, the heart rate is very high and elapsed time is not changing. Then I find treadmill data missing energy per hour and energy per minute, so heart rate and elapsed time is not correctly parsed.

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 fixes a critical data parsing bug in the Treadmill device implementation where missing energy-related parameters caused incorrect parsing of subsequent fields like heart rate and elapsed time when connected to real treadmill hardware.

Key Changes:

  • Added missing energyPerHour (2 bytes) and energyPerMinute (1 byte) parameters when expendedEnergyFlag is set
  • Renamed expendedEnergy to totalEnergy to align with the naming convention used in other device types (IndoorBike, Rower, CrossTrainer)
  • Fixed the FTMS Treadmill Data characteristic structure to match the Bluetooth specification

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

@Malte2036 Malte2036 merged commit 7864e64 into Malte2036:main Nov 22, 2025
7 checks passed
@Malte2036
Copy link
Owner

Thanks for your PR. It's released with flutter_ftms: 1.3.0

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