V1 FitPro: avoid auto WARM_UP on treadmill connect and add safe StopWorkout sequence - #4916
Merged
cagnulein merged 5 commits intoAug 16, 2026
Conversation
Owner
Author
|
#4931 closed in favour of this |
cagnulein
merged commit Aug 16, 2026
bd438b0
into
claude/fervent-newton-a25bb2
23 of 28 checks passed
cagnulein
deleted the
codex/fix-v1-treadmill-startup-and-stop-behaviors
branch
August 16, 2026 06:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
WORKOUT_MODE=WARM_UPduring startup, by keeping V1 treadmills in a stopped IDLE state until an explicit start is requested.Description
WARM_UPintransitionToActive()forDeviceType.TREADMILL; leave the treadmill inIDLEafterprepareConsole()so the belt cannot be started just by connecting. (Changed:V1Session.kt.)StopWorkoutcommand and map the JNIstopWorkout()to it instead ofPauseWorkout. (Changed:DeviceCommand.kt,FitProDeviceService.kt.)KPH=0+WORKOUT_MODE=PAUSE, poll KPH until stopped (bounded timeout), then write/confirmWORKOUT_MODE=IDLE, while keeping the USB session and poll loop active. This reuses and centralizes the safety-critical halt behavior used by disconnect teardown. (Changed:V1Session.kt.)V1Session.kt.)V2Session.kt.)WORKOUT_MODEwrites, explicitKPHwrites,IDLE_MODE_LOCKOUT/REQUIRE_START_REQUESTEDwrites, belt-halt phases and KPH readbacks, and richer diagnostics when poll responses are truncated (report requested/decoded field names and the MCU supported bitfield set). (Changed:V1Session.kt.)V1Session.kt.)src/android/fitpro/com/nettarion/hyperborea/core/model/DeviceCommand.kt,src/android/src/FitProDeviceService.kt,src/android/fitpro/com/nettarion/hyperborea/hardware/fitpro/v2/V2Session.kt,src/android/fitpro/com/nettarion/hyperborea/hardware/fitpro/v1/V1Session.kt.Testing
git diff --checkand inspected the produced diff and commit; changes are limited to the four FitPro files and commit created../gradlew compileDebugKotlin testDebugUnitTest) but the environment blocked dependency resolution (repository requests returned HTTP 403), so build and unit test execution could not complete here.StopWorkoutcommand is wired to the JNI surface and V1 stop sequence in code review and local static inspection.If you want I can (1) add unit tests using a mock/fake HidTransport for
V1Sessionexercising startup (no WARM_UP writes), Resume/Pause/Stop behaviours and truncated-response diagnostics, or (2) prepare a short hardware test plan with exact commands/logging to run on a V1 treadmill to validate KPH readback timing and the Stop timeout thresholds.Codex Task