Skip to content

Commit

Permalink
Unable to connect my Zwift Play to QZ (Issue #2458)
Browse files Browse the repository at this point in the history
  • Loading branch information
cagnulein committed Jul 22, 2024
1 parent 1bd865f commit f195ef1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4026,7 +4026,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "../src/ios/qdomyos-zwift.entitlements";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 821;
CURRENT_PROJECT_VERSION = 822;
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = NO;
GCC_PREPROCESSOR_DEFINITIONS = "ADB_HOST=1";
Expand Down Expand Up @@ -4217,7 +4217,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = "../src/ios/qdomyos-zwift.entitlements";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 821;
CURRENT_PROJECT_VERSION = 822;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -4444,7 +4444,7 @@
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 821;
CURRENT_PROJECT_VERSION = 822;
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -4540,7 +4540,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 821;
CURRENT_PROJECT_VERSION = 822;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 6335M7T29D;
ENABLE_BITCODE = YES;
Expand Down Expand Up @@ -4632,7 +4632,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 821;
CURRENT_PROJECT_VERSION = 822;
DEVELOPMENT_ASSET_PATHS = "\"watchkit Extension/Preview Content\"";
ENABLE_BITCODE = YES;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -4746,7 +4746,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_ENTITLEMENTS = "watchkit Extension/WatchKit Extension.entitlements";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 821;
CURRENT_PROJECT_VERSION = 822;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_ASSET_PATHS = "\"watchkit Extension/Preview Content\"";
ENABLE_BITCODE = YES;
Expand Down
23 changes: 21 additions & 2 deletions src/zwift_play/abstractZapDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ class AbstractZapDevice: public QObject {
}
}
break;
case 0x07:
if(bytes.length() > 3 && bytes[bytes.length() - 5] == 0x40 && (
case 0x07: // zwift play
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)
) && bytes[bytes.length() - 3] == 0x01) {
Expand All @@ -82,6 +82,25 @@ class AbstractZapDevice: public QObject {
}
}
break;
case 0x23: // zwift ride
if(bytes.length() > 12 &&
((((uint8_t)bytes[12]) == 0xc7 && zapType == RIGHT) ||
(((uint8_t)bytes[12]) == 0xc8 && zapType == LEFT))
) {
if(zapType == LEFT) {
emit plus();
} else {
emit minus();
}
}/* else if(bytes.length() > 14 && bytes[11] == 0x30 && bytes[12] == 0x00) {
if(zapType == LEFT) {
emit plus();
} else {
emit minus();
}
}*/
break;

}
return 1;
#endif
Expand Down

0 comments on commit f195ef1

Please sign in to comment.