Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/devices/ftmsbike/ftmsbike.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void ftmsbike::init() {
if (initDone)
return;

if(ICSE || HAMMER) {
if(ICSE || HAMMER || SPEEDMAGPRO) {
uint8_t write[] = {FTMS_REQUEST_CONTROL};
bool ret = writeCharacteristic(write, sizeof(write), "requestControl", false, true);
write[0] = {FTMS_RESET};
Expand Down Expand Up @@ -1779,6 +1779,11 @@ void ftmsbike::ftmsCharacteristicChanged(const QLowEnergyCharacteristic &charact
qDebug() << "applying gears mod" << gears() << gearsZwiftRatio() << power;
}*/

if(SPEEDMAGPRO && b.at(0) != FTMS_SET_INDOOR_BIKE_SIMULATION_PARAMS && b.at(0) != FTMS_SET_TARGET_POWER) {
qDebug() << "SpeedMagPro bike workaround: only allowing simulation params and power commands, discarding the rest";
return;
}

writeCharacteristic((uint8_t*)b.data(), b.length(), "injectWrite ", false, true);
}
}
Expand Down Expand Up @@ -2026,9 +2031,12 @@ void ftmsbike::deviceDiscovered(const QBluetoothDeviceInfo &device) {
ergModeSupported = false;
max_resistance = 32;
_ergTable.loadDefaultData(kSpeedRaceXDefaultErgData);
} else if(device.name().toUpper().startsWith("SPEEDMAGPRO")) {
qDebug() << QStringLiteral("SPEEDMAGPRO found");
ergModeSupported = false;
SPEEDMAGPRO = true;
}


if(settings.value(QZSettings::force_resistance_instead_inclination, QZSettings::default_force_resistance_instead_inclination).toBool()) {
resistance_lvl_mode = true;
}
Expand Down
1 change: 1 addition & 0 deletions src/devices/ftmsbike/ftmsbike.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ class ftmsbike : public bike {
bool S18 = false;
bool ZIPRO_RAVE = false;
bool SPEEDRACEX = false;
bool SPEEDMAGPRO = false;

uint8_t secondsToResetTimer = 5;

Expand Down
Loading