From 717d90b98c93be1915b2a184a669aa65f4337736 Mon Sep 17 00:00:00 2001 From: Roberto Viola Date: Fri, 5 Jan 2024 14:35:24 +0000 Subject: [PATCH] Atletica Lightspeed Treadmill start issue (Fitshow) #1950 (#1954) * Atletica Lightspeed Treadmill start issue (Fitshow) #1950 * Update fitshowtreadmill.cpp --- src/fitshowtreadmill.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/fitshowtreadmill.cpp b/src/fitshowtreadmill.cpp index 6b5645be9..a6dc49933 100644 --- a/src/fitshowtreadmill.cpp +++ b/src/fitshowtreadmill.cpp @@ -158,7 +158,7 @@ void fitshowtreadmill::update() { if (initRequest) { initRequest = false; - btinit((lastSpeed > 0 ? true : false)); + btinit(true); } else if (bluetoothDevice.isValid() && m_control->state() == QLowEnergyController::DiscoveredState && gattCommunicationChannelService && gattWriteCharacteristic.isValid() && gattNotifyCharacteristic.isValid() && initDone) { @@ -220,7 +220,22 @@ void fitshowtreadmill::update() { if (lastSpeed == 0.0) { lastSpeed = 0.5; } - btinit(true); + + uint8_t startTape1[] = { + FITSHOW_SYS_CONTROL, + FITSHOW_CONTROL_READY_OR_START, + (FITSHOW_TREADMILL_SPORT_ID >> 0) & 0xFF, + (FITSHOW_TREADMILL_SPORT_ID >> 8) & 0xFF, + (FITSHOW_TREADMILL_SPORT_ID >> 16) & 0xFF, + (FITSHOW_TREADMILL_SPORT_ID >> 24) & 0xFF, + FITSHOW_SYS_MODE_NORMAL, + 0x00, // number of blocks (u8) + 0x00, + 0x00 // mode-dependent value (u16le) + }; // to verify + scheduleWrite(startTape1, sizeof(startTape1), QStringLiteral("init_start")); + forceSpeedOrIncline(lastSpeed, lastInclination); + lastStart = QDateTime::currentMSecsSinceEpoch(); requestStart = -1; emit tapeStarted();