Skip to content

Commit

Permalink
BT Log share for LifeSpan-TM-2000 (Issue #3021)
Browse files Browse the repository at this point in the history
  • Loading branch information
cagnulein committed Jan 12, 2025
1 parent 61bf953 commit c206886
Show file tree
Hide file tree
Showing 5 changed files with 508 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/devices/bluetooth.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1850,6 +1850,20 @@ void bluetooth::deviceDiscovered(const QBluetoothDeviceInfo &device) {
connect(ziproTreadmill, &ziprotreadmill::inclinationChanged, this, &bluetooth::inclinationChanged);
ziproTreadmill->deviceDiscovered(b);
this->signalBluetoothDeviceConnected(ziproTreadmill);
} else if ((b.name().toUpper().startsWith(QLatin1String("LIFESPAN-TM"))) && !lifespanTreadmill && filter) {
this->setLastBluetoothDevice(b);
this->stopDiscovery();
lifespanTreadmill = new lifespantreadmill(this->pollDeviceTime, noConsole, noHeartService);
// stateFileRead();
emit deviceConnected(b);
connect(lifespanTreadmill, &bluetoothdevice::connectedAndDiscovered, this,
&bluetooth::connectedAndDiscovered);
// connect(ziproTreadmill, SIGNAL(disconnected()), this, SLOT(restart())); connect(echelonStride,
connect(lifespanTreadmill, &lifespantreadmill::debug, this, &bluetooth::debug);
connect(lifespanTreadmill, &lifespantreadmill::speedChanged, this, &bluetooth::speedChanged);
connect(lifespanTreadmill, &lifespantreadmill::inclinationChanged, this, &bluetooth::inclinationChanged);
lifespanTreadmill->deviceDiscovered(b);
this->signalBluetoothDeviceConnected(lifespanTreadmill);
} else if ((b.name().startsWith(QStringLiteral("ECH-ROW")) ||
b.name().toUpper().startsWith(QStringLiteral("ROWSPORT")) ||
b.name().startsWith(QStringLiteral("ROW-S"))) &&
Expand Down Expand Up @@ -3305,6 +3319,10 @@ void bluetooth::restart() {
delete ziproTreadmill;
ziproTreadmill = nullptr;
}
if (lifespanTreadmill) {
delete lifespanTreadmill;
lifespanTreadmill = nullptr;
}
if (octaneElliptical) {

delete octaneElliptical;
Expand Down Expand Up @@ -3711,6 +3729,8 @@ bluetoothdevice *bluetooth::device() {
return octaneTreadmill;
} else if (ziproTreadmill) {
return ziproTreadmill;
} else if (lifespanTreadmill) {
return lifespanTreadmill;
} else if (octaneElliptical) {
return octaneElliptical;
} else if (ftmsRower) {
Expand Down
2 changes: 2 additions & 0 deletions src/devices/bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
#include "devices/kingsmithr1protreadmill/kingsmithr1protreadmill.h"
#include "devices/kingsmithr2treadmill/kingsmithr2treadmill.h"
#include "devices/lifefitnesstreadmill/lifefitnesstreadmill.h"
#include "devices/lifespantreadmill/lifespantreadmill.h"
#include "devices/m3ibike/m3ibike.h"
#include "devices/mcfbike/mcfbike.h"
#include "devices/mepanelbike/mepanelbike.h"
Expand Down Expand Up @@ -256,6 +257,7 @@ class bluetooth : public QObject, public SignalHandler {
smartrowrower *smartrowRower = nullptr;
echelonstride *echelonStride = nullptr;
lifefitnesstreadmill *lifefitnessTreadmill = nullptr;
lifespantreadmill *lifespanTreadmill = nullptr;
keepbike *keepBike = nullptr;
kingsmithr1protreadmill *kingsmithR1ProTreadmill = nullptr;
kingsmithr2treadmill *kingsmithR2Treadmill = nullptr;
Expand Down
Loading

0 comments on commit c206886

Please sign in to comment.