Repository navigation
Adds support for the KingSmith R3 and makes FTMS command handling safer under concurrency. Thanks @pookey (#8).
- KingSmith R3 (
KS-AP-*, model KS-R3Q): detected as FTMS and tested with connect, start, set speed, pause and stop. - Pause before STOP on the R3: the R3 rejects FTMS STOP while the belt moves. For devices in
FTMS_PAUSE_BEFORE_STOP_PREFIXES(currently onlyKS-AP-),stop()pauses first. It sends STOP only after a fresh Treadmill Data frame reports 0 km/h. STOP rejected during the R3's 3-2-1 start countdown is handled too. Other FTMS devices still send a single STOP. - Command serialisation (all FTMS devices):
start,stop,set_target_speed,set_target_inclinationandresetnow run under an operation lock, and Control Point write-and-ack has its own lock. A speed command issued whilestart()waits for the belt now queues behind it instead of interleaving.pause()only takes the Control Point lock, so it can still halt the belt. - STOP result (all FTMS devices): if the STOP indication is dropped but FM Status reports the session ended (
02 01),stop()now returns success. - Clearer logs when a stop can't be confirmed (connection lost, no telemetry, belt still moving, no active session).