Skip to content

Commit 5b0c005

Browse files
authored
FitBike Ride 6 iPlus (2014 iConsole Legacy) (#4118)
1 parent d7c3319 commit 5b0c005

5 files changed

Lines changed: 586 additions & 3 deletions

File tree

src/devices/bluetooth.cpp

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,10 @@ void bluetooth::deviceDiscovered(const QBluetoothDeviceInfo &device) {
577577
QString ftms_bike = settings.value(QZSettings::ftms_bike, QZSettings::default_ftms_bike).toString();
578578
QString ftms_treadmill = settings.value(QZSettings::ftms_treadmill, QZSettings::default_ftms_treadmill).toString();
579579
QString ftms_elliptical = settings.value(QZSettings::ftms_elliptical, QZSettings::default_ftms_elliptical).toString();
580-
bool saris_trainer = settings.value(QZSettings::saris_trainer, QZSettings::default_saris_trainer).toBool();
580+
bool saris_trainer = settings.value(QZSettings::saris_trainer, QZSettings::default_saris_trainer).toBool();
581581
bool iconsole_elliptical = settings.value(QZSettings::iconsole_elliptical, QZSettings::default_iconsole_elliptical).toBool();
582582
bool iconsole_rower = settings.value(QZSettings::iconsole_rower, QZSettings::default_iconsole_rower).toBool();
583+
bool trx_route_key = settings.value(QZSettings::trx_route_key, QZSettings::default_trx_route_key).toBool();
583584

584585
if (!heartRateBeltFound) {
585586

@@ -2595,6 +2596,15 @@ void bluetooth::deviceDiscovered(const QBluetoothDeviceInfo &device) {
25952596
// SLOT(inclinationChanged(double)));
25962597
mcfBike->deviceDiscovered(b);
25972598
this->signalBluetoothDeviceConnected(mcfBike);
2599+
} else if (b.name().toUpper().startsWith(QStringLiteral("ICONSOLE+")) && !iconsole && trx_route_key) {
2600+
this->setLastBluetoothDevice(b);
2601+
this->stopDiscovery();
2602+
iconsole = new iconsolebike(noWriteResistance, noHeartService, bikeResistanceOffset, bikeResistanceGain);
2603+
emit deviceConnected(b);
2604+
connect(iconsole, &bluetoothdevice::connectedAndDiscovered, this, &bluetooth::connectedAndDiscovered);
2605+
connect(iconsole, &iconsolebike::debug, this, &bluetooth::debug);
2606+
iconsole->deviceDiscovered(b);
2607+
this->signalBluetoothDeviceConnected(iconsole);
25982608
} else if ((b.name().startsWith(QStringLiteral("TRX ROUTE KEY")) ||
25992609
b.name().toUpper().startsWith(QStringLiteral("MASTERT40-")) ||
26002610
b.name().toUpper().startsWith(QStringLiteral("BH DUALKIT TREAD")) ||
@@ -2611,7 +2621,7 @@ void bluetooth::deviceDiscovered(const QBluetoothDeviceInfo &device) {
26112621
this->signalBluetoothDeviceConnected(toorx);
26122622
} else if (((b.name().toUpper().startsWith(QStringLiteral("BH DUALKIT")) && !b.name().toUpper().startsWith(QStringLiteral("BH DUALKIT TREAD"))) ||
26132623
b.name().toUpper().startsWith(QStringLiteral("BH-"))) && !iConceptBike && !toorx &&
2614-
!iconcept_elliptical && filter) {
2624+
!iconcept_elliptical && !iconsole && filter) {
26152625
this->setLastBluetoothDevice(b);
26162626
this->stopDiscovery();
26172627
iConceptBike = new iconceptbike();
@@ -2623,7 +2633,7 @@ void bluetooth::deviceDiscovered(const QBluetoothDeviceInfo &device) {
26232633
iConceptBike->deviceDiscovered(b);
26242634
this->signalBluetoothDeviceConnected(iConceptBike);
26252635
} else if ((b.name().toUpper().startsWith(QStringLiteral("BH DUALKIT"))) && !iConceptElliptical &&
2626-
iconcept_elliptical && filter) {
2636+
iconcept_elliptical && !iconsole && filter) {
26272637
this->setLastBluetoothDevice(b);
26282638
this->stopDiscovery();
26292639
iConceptElliptical =
@@ -3738,6 +3748,11 @@ void bluetooth::restart() {
37383748
delete toorx;
37393749
toorx = nullptr;
37403750
}
3751+
if (iconsole) {
3752+
3753+
delete iconsole;
3754+
iconsole = nullptr;
3755+
}
37413756
if (iConceptBike) {
37423757

37433758
delete iConceptBike;
@@ -4203,6 +4218,8 @@ bluetoothdevice *bluetooth::device() {
42034218
return stagesBike;
42044219
} else if (toorx) {
42054220
return toorx;
4221+
} else if (iconsole) {
4222+
return iconsole;
42064223
} else if (iConceptBike) {
42074224
return iConceptBike;
42084225
} else if (iConceptElliptical) {

src/devices/bluetooth.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
#include "templateinfosenderbuilder.h"
143143
#include "technogymbike/technogymbike.h"
144144
#include "devices/toorxtreadmill/toorxtreadmill.h"
145+
#include "devices/iconsolebike/iconsolebike.h"
145146
#include "devices/treadmill.h"
146147
#include "devices/truetreadmill/truetreadmill.h"
147148
#include "devices/trxappgateusbbike/trxappgateusbbike.h"
@@ -210,6 +211,7 @@ class bluetooth : public QObject, public SignalHandler {
210211
domyosrower *domyosRower = nullptr;
211212
domyoselliptical *domyosElliptical = nullptr;
212213
toorxtreadmill *toorx = nullptr;
214+
iconsolebike *iconsole = nullptr;
213215
iconceptbike *iConceptBike = nullptr;
214216
iconceptelliptical *iConceptElliptical = nullptr;
215217
trxappgateusbtreadmill *trxappgateusb = nullptr;

0 commit comments

Comments
 (0)