@@ -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) {
0 commit comments