Skip to content

Commit 8229517

Browse files
committed
SunnyFit Stepper
1 parent 72f5705 commit 8229517

8 files changed

Lines changed: 757 additions & 0 deletions

File tree

.claude/settings.local.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(tshark:*)",
5+
"Bash(find:*)",
6+
"Bash(python3:*)"
7+
]
8+
}
9+
}

src/devices/bluetooth.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,6 +2016,19 @@ void bluetooth::deviceDiscovered(const QBluetoothDeviceInfo &device) {
20162016
connect(echelonStairclimber, &echelonstairclimber::inclinationChanged, this, &bluetooth::inclinationChanged);
20172017
echelonStairclimber->deviceDiscovered(b);
20182018
this->signalBluetoothDeviceConnected(echelonStairclimber);
2019+
} else if (b.name().toUpper().startsWith(QLatin1String("SF-S")) &&
2020+
!sunnyfitStepper && filter) {
2021+
this->setLastBluetoothDevice(b);
2022+
this->stopDiscovery();
2023+
sunnyfitStepper = new sunnyfitstepper(this->pollDeviceTime, noConsole, noHeartService);
2024+
emit deviceConnected(b);
2025+
connect(sunnyfitStepper, &bluetoothdevice::connectedAndDiscovered, this,
2026+
&bluetooth::connectedAndDiscovered);
2027+
connect(sunnyfitStepper, &sunnyfitstepper::debug, this, &bluetooth::debug);
2028+
connect(sunnyfitStepper, &sunnyfitstepper::speedChanged, this, &bluetooth::speedChanged);
2029+
connect(sunnyfitStepper, &sunnyfitstepper::inclinationChanged, this, &bluetooth::inclinationChanged);
2030+
sunnyfitStepper->deviceDiscovered(b);
2031+
this->signalBluetoothDeviceConnected(sunnyfitStepper);
20192032
} else if ((b.name().toUpper().startsWith(QLatin1String("ECH-STRIDE")) ||
20202033
b.name().toUpper().startsWith(QLatin1String("ECH-UK-")) ||
20212034
b.name().toUpper().startsWith(QLatin1String("ECH-FR-")) ||
@@ -3615,6 +3628,11 @@ void bluetooth::restart() {
36153628
delete echelonStairclimber;
36163629
echelonStairclimber = nullptr;
36173630
}
3631+
if (sunnyfitStepper) {
3632+
3633+
delete sunnyfitStepper;
3634+
sunnyfitStepper = nullptr;
3635+
}
36183636
if (octaneTreadmill) {
36193637

36203638
delete octaneTreadmill;
@@ -4044,6 +4062,8 @@ bluetoothdevice *bluetooth::device() {
40444062
return echelonStride;
40454063
} else if (echelonStairclimber) {
40464064
return echelonStairclimber;
4065+
} else if (sunnyfitStepper) {
4066+
return sunnyfitStepper;
40474067
} else if (octaneTreadmill) {
40484068
return octaneTreadmill;
40494069
} else if (ziproTreadmill) {

src/devices/bluetooth.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
#include "signalhandler.h"
113113
#include "devices/skandikawiribike/skandikawiribike.h"
114114
#include "devices/smartrowrower/smartrowrower.h"
115+
#include "devices/sunnyfitstepper/sunnyfitstepper.h"
115116
#include "devices/smartspin2k/smartspin2k.h"
116117
#include "devices/snodebike/snodebike.h"
117118
#include "devices/strydrunpowersensor/strydrunpowersensor.h"
@@ -269,6 +270,7 @@ class bluetooth : public QObject, public SignalHandler {
269270
echelonrower *echelonRower = nullptr;
270271
ftmsrower *ftmsRower = nullptr;
271272
smartrowrower *smartrowRower = nullptr;
273+
sunnyfitstepper *sunnyfitStepper = nullptr;
272274
echelonstride *echelonStride = nullptr;
273275
echelonstairclimber *echelonStairclimber = nullptr;
274276
lifefitnesstreadmill *lifefitnessTreadmill = nullptr;

0 commit comments

Comments
 (0)