Skip to content

Commit 4e815f2

Browse files
committed
Limit TC rower subscriptions to FTMS
1 parent b2fd42f commit 4e815f2

2 files changed

Lines changed: 15 additions & 4 deletions

File tree

src/devices/ftmsrower/ftmsrower.cpp

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -605,10 +605,10 @@ void ftmsrower::stateChanged(QLowEnergyService::ServiceState state) {
605605
connect(s, &QLowEnergyService::descriptorWritten, this, &ftmsrower::descriptorWritten);
606606
connect(s, &QLowEnergyService::descriptorRead, this, &ftmsrower::descriptorRead);
607607

608-
if (I_ROWER || SF_RW || ROWER || MRK_R06 || DOMYOS) {
608+
if (I_ROWER || SF_RW || ROWER || MRK_R06 || DOMYOS || TC_ROWER) {
609609
QBluetoothUuid ftmsService((quint16)0x1826);
610610
if (s->serviceUuid() != ftmsService) {
611-
qDebug() << QStringLiteral("I-ROWER/SF-RW/ROWER/MRK-R06/DOMYOS wants to be subscribed only to FTMS service in order to send metrics")
611+
qDebug() << QStringLiteral("I-ROWER/SF-RW/ROWER/MRK-R06/DOMYOS/TC rowers want to be subscribed only to FTMS service in order to send metrics")
612612
<< s->serviceUuid();
613613
continue;
614614
}
@@ -801,8 +801,8 @@ void ftmsrower::serviceScanDone(void) {
801801
}
802802

803803
for (const QBluetoothUuid &s : qAsConst(services_list)) {
804-
// For DOMYOS, discover only FTMS service (0x1826)
805-
if (DOMYOS) {
804+
// For DOMYOS and TC rowers, discover only FTMS service (0x1826)
805+
if (DOMYOS || TC_ROWER) {
806806
QBluetoothUuid ftmsService((quint16)0x1826);
807807
if (s != ftmsService) {
808808
continue;
@@ -880,6 +880,16 @@ void ftmsrower::deviceDiscovered(const QBluetoothDeviceInfo &device) {
880880
} else if (device.name().toUpper().startsWith(QStringLiteral("DOMYOS-ROW-"))) {
881881
DOMYOS = true;
882882
qDebug() << "DOMYOS found!";
883+
} else if (deviceName.size() > 2 && deviceName.startsWith(QStringLiteral("TC"))) {
884+
TC_ROWER = true;
885+
for (int i = 2; i < deviceName.size(); ++i) {
886+
if (!deviceName.at(i).isDigit()) {
887+
TC_ROWER = false;
888+
break;
889+
}
890+
}
891+
if (TC_ROWER)
892+
qDebug() << "TC rower found! discovering only FTMS service";
883893
} else if (deviceName.size() >= 7 && deviceName.startsWith(QStringLiteral("WDK")) &&
884894
deviceName.at(3).isDigit() && deviceName.at(4).isDigit() &&
885895
deviceName.at(5).isDigit() && deviceName.at(6).isDigit()) {

src/devices/ftmsrower/ftmsrower.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class ftmsrower : public rower {
7474
bool ICONSOLE_PLUS = false;
7575
bool FITSHOW = false;
7676
bool DOMYOS = false;
77+
bool TC_ROWER = false;
7778
bool WDK_PACE_POWER = false;
7879

7980
bool WATER_ROWER = false;

0 commit comments

Comments
 (0)