Skip to content

Switch 0w ERG targets to sim mode#736

Draft
Copilot wants to merge 4 commits into
developfrom
copilot/fix-erg-mode-free-ride
Draft

Switch 0w ERG targets to sim mode#736
Copilot wants to merge 4 commits into
developfrom
copilot/fix-erg-mode-free-ride

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

MyWhoosh sends 0w ERG targets during free-ride segments instead of switching to simulation mode. Treating those as normal ERG targets prevents normal shifting during free ride.

  • FTMS target handling
    • Detect SetTargetPower requests with a 0w target using an inline target power check.
    • Switch runtime FTMS mode to SetIndoorBikeSimulationParameters.
    • Reset target watts/incline for free ride.
    • Forward default sim-mode parameters to connected FTMS trainers.
if (requestedTargetPower == 0) {
  rtConfig->setFTMSMode(FitnessMachineControlPointProcedure::SetIndoorBikeSimulationParameters);
  rtConfig->watts.setTarget(0);
  rtConfig->setTargetIncline(0);
  spinBLEClient.FTMSControlPointWrite(simMode, sizeof(simMode));
}

Copilot AI and others added 2 commits May 12, 2026 15:42
Agent-Logs-Url: https://github.com/doudar/SmartSpin2k/sessions/33f20c65-9299-4587-81af-67f21f7b2a65

Co-authored-by: doudar <17362216+doudar@users.noreply.github.com>
Agent-Logs-Url: https://github.com/doudar/SmartSpin2k/sessions/33f20c65-9299-4587-81af-67f21f7b2a65

Co-authored-by: doudar <17362216+doudar@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix ERG mode behavior during free ride segments Switch 0w ERG targets to sim mode May 12, 2026
Copilot AI requested a review from doudar May 12, 2026 15:46
Copilot finished work on behalf of doudar May 12, 2026 15:46
@doudar
Copy link
Copy Markdown
Owner

doudar commented May 12, 2026

this is looking good, but You can remove the tests, and I don't see the need to include FTMS_Utils.h you can just do an inline test to see if the requested power == 0;

@doudar
Copy link
Copy Markdown
Owner

doudar commented May 12, 2026

@copilot this is looking good, but You can remove the tests, and I don't see the need to include FTMS_Utils.h you can just do an inline test to see if the requested power == 0;

Agent-Logs-Url: https://github.com/doudar/SmartSpin2k/sessions/760e2bb2-08f2-4f1e-b692-ec66f9a3726b

Co-authored-by: doudar <17362216+doudar@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 12, 2026

this is looking good, but You can remove the tests, and I don't see the need to include FTMS_Utils.h you can just do an inline test to see if the requested power == 0;

Addressed in cc7c001 by removing the added tests and FTMS_Utils.h, and using an inline requestedTargetPower == 0 check.

@copilot this is looking good, but You can remove the tests, and I don't see the need to include FTMS_Utils.h you can just do an inline test to see if the requested power == 0;

Addressed in cc7c001 by removing the added tests and FTMS_Utils.h, and using an inline requestedTargetPower == 0 check.

Copilot finished work on behalf of doudar May 12, 2026 21:50
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.

[BUG] MyWhoosh sets 0 watts during free-ride in ERG mode instead of sending sim mode

2 participants