Skip to content

Commit 27cef81

Browse files
authored
Add MRK-S36C device quirk for resistance-level ERG control (#4827)
* Add MRK-S36C device quirk for resistance-level ERG control The MRK-S36C bike is a generic FTMS device with no matching quirk, so it defaulted to ergModeSupported=true. When an app targets ERG mode (SetTargetPower) over Dircon, ftmsbike's power routing only forwards the request when the bike is non-FTMS or a power sensor is configured, so the target power request was silently dropped and resistance froze at its last value instead of following the workout. Detect the bike by name and force resistance-level mode with ergModeSupported=false, matching other MRK bikes, so target power is converted to a resistance level via the erg table instead. * Add MRK_S36C condition for resistance calculation
1 parent 96acc90 commit 27cef81

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/devices/ftmsbike/ftmsbike.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ void ftmsbike::forceResistance(resistance_t requestResistance) {
354354
QStringLiteral("forceResistance ") + QString::number(requestResistance));
355355
} else {
356356
uint8_t write[] = {FTMS_SET_TARGET_RESISTANCE_LEVEL, 0x00};
357-
if(_3G_Cardio_RB || SL010)
357+
if(_3G_Cardio_RB || SL010 || MRK_S36C)
358358
requestResistance = requestResistance * 10;
359359
write[1] = ((uint8_t)(requestResistance));
360360
writeCharacteristic(write, sizeof(write),
@@ -2124,6 +2124,11 @@ void ftmsbike::deviceDiscovered(const QBluetoothDeviceInfo &device) {
21242124
qDebug() << QStringLiteral("MRK-S28 found");
21252125
MRK_S28 = true;
21262126
resistance_lvl_mode = true;
2127+
} else if(device.name().toUpper().startsWith("MRK-S36C-")) {
2128+
qDebug() << QStringLiteral("MRK-S36C found");
2129+
MRK_S36C = true;
2130+
resistance_lvl_mode = true;
2131+
ergModeSupported = false; // this bike doesn't have ERG mode natively, target power must be converted to resistance
21272132
} else if(device.name().toUpper().startsWith("HAMMER")) {
21282133
qDebug() << QStringLiteral("HAMMER found");
21292134
HAMMER = true;

src/devices/ftmsbike/ftmsbike.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ class ftmsbike : public bike {
199199
bool MAGNUS = false;
200200
bool MRK_S26C = false;
201201
bool MRK_S28 = false;
202+
bool MRK_S36C = false;
202203
bool HAMMER = false;
203204
bool YPBM = false;
204205
bool SPORT01 = false;

0 commit comments

Comments
 (0)