Skip to content

Support 13-character CARE Sports Plus bikes - #4878

Draft
cagnulein wants to merge 2 commits into
masterfrom
codex/care-sportsplus-bike-parser
Draft

Support 13-character CARE Sports Plus bikes#4878
cagnulein wants to merge 2 commits into
masterfrom
codex/care-sportsplus-bike-parser

Conversation

@cagnulein

Copy link
Copy Markdown
Owner

Summary

Adds support for the 13-character CARE Sports Plus bike identified in the user-provided log as CARE113770737.

The detection rule is intentionally specific:

  • CARE prefix
  • total Bluetooth name length of 13 characters
  • numeric suffix
  • first numeric character is 1

This routes CARE113770737 to sportsplusbike while preserving the existing CARE device classifications.

Analysis

Device-name classification

A 13-character name alone is not sufficient:

  • CARE113770737: 13 characters, suffix starts with 1 → bike
  • CARE10692135: 12 characters → known Sports Plus rower
  • CARE968300122: 13 characters, but suffix starts with 9 → known rower
  • CARE9040177: 11 characters → existing legacy Care bike detection

This avoids broadening the existing rower rule (CARE names with length >= 12) to the user's bike.

GitHub protocol references

The analysis was cross-checked against the existing CARE reports:

User-provided log analysis

The current log contains:

  • 1,800 12-byte telemetry frames
  • 900 frames with type 20 10
  • 900 frames with type 20 00
  • outgoing resistance/gear commands using 20 01
  • repeated initialization frame 40 00 9a 56 30

The frame parser validates:

  • frame length: 12 bytes
  • header/type: 20 10 or 20 00
  • checksum: sum of bytes 0..10 modulo 256 equals byte 11
  • cadence: packed BCD in byte 3 for 20 10 frames
  • watts: packed BCD in byte 10

The byte-10 watt decoding matches the watt value printed in the log for 1,799 correlated telemetry frames. Speed uses the same cadence-to-speed coefficient already used by the Sports Plus rower parser.

Implementation

  • Routes the specific CARE 13-character bike to sportsplusbike.
  • Adds the dedicated CARE Sports Plus bike parser branch.
  • Uses frame wattage for power-based speed calculations, with resistance-derived watts only as fallback for invalid packets.
  • Adds regression coverage for device-name detection, real log frames, cadence, watts, speed, and invalid checksums.
  • Registers CARE113770737 in the device detection test data.

Validation

  • git diff --check: passed.
  • sportsplusbike.cpp: compiled successfully with the existing Qt 5.15.2 MinGW build.
  • bluetooth.cpp: compiled successfully.
  • device test registry: compiled successfully.
  • TestSportsPlusBikeParser.cpp: compiled successfully.

The complete test-suite executable was not linked because the local temporary reconstruction of the pre-existing static application library has unrelated unresolved application/moc dependencies.

The outgoing 20 01 resistance command was not changed in this PR. Its effect on the bike's physical resistance still requires validation with the real Care Cardio Liner IX.

@cagnulein
cagnulein marked this pull request as ready for review August 3, 2026 10:36

Copy link
Copy Markdown
Owner Author

Follow-up detection hardening: the generic CARE rower branch now explicitly excludes isCareSportsPlusBike13Name(b.name()). The else if ordering handles the normal discovery path, but this negative guard also prevents the 13-character CARE bike from falling through to rower classification if the bike instance already exists during rediscovery/state transitions. bluetooth.cpp was recompiled successfully after this change.

@cagnulein
cagnulein marked this pull request as draft August 3, 2026 10:41
@cagnulein
cagnulein force-pushed the codex/care-sportsplus-bike-parser branch from 1de6cc0 to 850e38d Compare August 3, 2026 10:58
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