Skip to content

Commit

Permalink
Unable to connect Tunturi T60[BUG] (Issue #1932)
Browse files Browse the repository at this point in the history
  • Loading branch information
cagnulein committed Jan 7, 2024
1 parent 463c349 commit 5d4665b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/horizontreadmill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,9 @@ void horizontreadmill::forceIncline(double requestIncline) {
bool horizon_paragon_x =
settings.value(QZSettings::horizon_paragon_x, QZSettings::default_horizon_paragon_x).toBool();

if(tunturi_t60_treadmill)
Inclination = requestIncline;

if (gattCustomService) {
if (!horizon_paragon_x) {
messageID++;
Expand Down Expand Up @@ -1488,9 +1491,10 @@ void horizontreadmill::characteristicChanged(const QLowEnergyCharacteristic &cha
emit debug(QStringLiteral("Current Distance: ") + QString::number(Distance.value()));

if (Flags.inclination) {
Inclination = ((double)(((uint16_t)((uint8_t)newValue.at(index + 1)) << 8) |
(uint16_t)((uint8_t)newValue.at(index)))) /
10.0;
if(!tunturi_t60_treadmill)
Inclination = ((double)(((uint16_t)((uint8_t)newValue.at(index + 1)) << 8) |
(uint16_t)((uint8_t)newValue.at(index)))) /
10.0;
index += 4; // the ramo value is useless
emit debug(QStringLiteral("Current Inclination: ") + QString::number(Inclination.value()));
}
Expand Down Expand Up @@ -1993,6 +1997,9 @@ void horizontreadmill::deviceDiscovered(const QBluetoothDeviceInfo &device) {
} else if (device.name().toUpper().startsWith(QStringLiteral("ANPLUS-"))) {
anplus_treadmill = true;
qDebug() << QStringLiteral("ANPLUS TREADMILL workaround ON!");
} else if (device.name().toUpper().startsWith(QStringLiteral("TUNTURI T60-"))) {
tunturi_t60_treadmill = true;
qDebug() << QStringLiteral("TUNTURI T60 TREADMILL workaround ON!");
}

#ifdef Q_OS_IOS
Expand Down
1 change: 1 addition & 0 deletions src/horizontreadmill.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class horizontreadmill : public treadmill {
bool mobvoi_treadmill = false;
bool kettler_treadmill = false;
bool anplus_treadmill = false;
bool tunturi_t60_treadmill = false;

void testProfileCRC();
void updateProfileCRC();
Expand Down

0 comments on commit 5d4665b

Please sign in to comment.