diff --git a/build-qdomyos-zwift-Qt_5_15_2_for_iOS-Debug/qdomyoszwift.xcodeproj/project.pbxproj b/build-qdomyos-zwift-Qt_5_15_2_for_iOS-Debug/qdomyoszwift.xcodeproj/project.pbxproj index 1b5561479..994bab5c4 100644 --- a/build-qdomyos-zwift-Qt_5_15_2_for_iOS-Debug/qdomyoszwift.xcodeproj/project.pbxproj +++ b/build-qdomyos-zwift-Qt_5_15_2_for_iOS-Debug/qdomyoszwift.xcodeproj/project.pbxproj @@ -4187,7 +4187,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = "../src/ios/qdomyos-zwift.entitlements"; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 977; + CURRENT_PROJECT_VERSION = 976; DEVELOPMENT_TEAM = 6335M7T29D; ENABLE_BITCODE = NO; GCC_PREPROCESSOR_DEFINITIONS = "ADB_HOST=1"; @@ -4381,7 +4381,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = "../src/ios/qdomyos-zwift.entitlements"; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 977; + CURRENT_PROJECT_VERSION = 976; DEBUG_INFORMATION_FORMAT = dwarf; DEVELOPMENT_TEAM = 6335M7T29D; ENABLE_BITCODE = NO; @@ -4611,7 +4611,7 @@ CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 977; + CURRENT_PROJECT_VERSION = 976; DEVELOPMENT_TEAM = 6335M7T29D; ENABLE_BITCODE = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -4707,7 +4707,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 977; + CURRENT_PROJECT_VERSION = 976; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = 6335M7T29D; ENABLE_BITCODE = YES; @@ -4799,7 +4799,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 977; + CURRENT_PROJECT_VERSION = 976; DEVELOPMENT_ASSET_PATHS = "\"watchkit Extension/Preview Content\""; ENABLE_BITCODE = YES; ENABLE_PREVIEWS = YES; @@ -4913,7 +4913,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 977; + CURRENT_PROJECT_VERSION = 976; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_ASSET_PATHS = "\"watchkit Extension/Preview Content\""; ENABLE_BITCODE = YES; diff --git a/src/zwift_play/abstractZapDevice.h b/src/zwift_play/abstractZapDevice.h index fa5c39459..8f9672320 100755 --- a/src/zwift_play/abstractZapDevice.h +++ b/src/zwift_play/abstractZapDevice.h @@ -28,7 +28,7 @@ class AbstractZapDevice: public QObject { QByteArray REQUEST_START; QByteArray RESPONSE_START; - AbstractZapDevice() : autoRepeatTimer(new QTimer(this)), watchdogTimer(new QTimer(this)) { + AbstractZapDevice() : autoRepeatTimer(new QTimer(this)) { RIDE_ON = QByteArray::fromRawData("\x52\x69\x64\x65\x4F\x6E", 6); // "RideOn" REQUEST_START = QByteArray::fromRawData("\x00\x09", 2); // {0, 9} RESPONSE_START = QByteArray::fromRawData("\x01\x03", 2); // {1, 3} @@ -36,10 +36,6 @@ class AbstractZapDevice: public QObject { // Setup auto-repeat autoRepeatTimer->setInterval(500); connect(autoRepeatTimer, &QTimer::timeout, this, &AbstractZapDevice::handleAutoRepeat); - - // Setup watchdog timer - watchdogTimer->setInterval(400); // 400ms timeout, shorter than auto-repeat - connect(watchdogTimer, &QTimer::timeout, this, &AbstractZapDevice::handleWatchdogTimeout); } int processCharacteristic(const QString& characteristicName, const QByteArray& bytes, ZWIFT_PLAY_TYPE zapType) { @@ -72,10 +68,6 @@ class AbstractZapDevice: public QObject { #else switch(bytes[0]) { case 0x37: - if (autoRepeatTimer->isActive()) { - watchdogTimer->start(); - } - if(bytes.length() == 5) { if(bytes[2] == 0) { if(DEBOUNCE) { @@ -109,18 +101,12 @@ class AbstractZapDevice: public QObject { risingEdge--; if(risingEdge < 0) risingEdge = 0; - if(risingEdge == 0) { + if(risingEdge == 0) autoRepeatTimer->stop(); - watchdogTimer->stop(); - } } } break; case 0x07: // zwift play - if (autoRepeatTimer->isActive()) { - watchdogTimer->start(); - } - if(bytes.length() > 5 && bytes[bytes.length() - 5] == 0x40 && ( (((uint8_t)bytes[bytes.length() - 4]) == 0xc7 && zapType == RIGHT) || (((uint8_t)bytes[bytes.length() - 4]) == 0xc8 && zapType == LEFT) @@ -196,10 +182,6 @@ class AbstractZapDevice: public QObject { qDebug() << "ignoring this frame"; return 1; case 0x23: // zwift ride - if (autoRepeatTimer->isActive()) { - watchdogTimer->start(); - } - if(bytes.length() > 12 && ((((uint8_t)bytes[12]) == 0xc7 && zapType == RIGHT) || (((uint8_t)bytes[12]) == 0xc8 && zapType == LEFT)) @@ -337,7 +319,6 @@ class AbstractZapDevice: public QObject { QByteArray devicePublicKeyBytes; static volatile int8_t risingEdge; QTimer* autoRepeatTimer; // Timer for auto-repeat - QTimer* watchdogTimer; // Watchdog timer to detect frame absence bool lastButtonPlus = false; // Track which button was last pressed private slots: @@ -348,13 +329,6 @@ class AbstractZapDevice: public QObject { emit minus(); } - void handleWatchdogTimeout() { - // No frames received for too long, stop auto-repeat - watchdogTimer->stop(); - autoRepeatTimer->stop(); - risingEdge = 0; - } - signals: void plus(); void minus();