-
-
Notifications
You must be signed in to change notification settings - Fork 207
Expand file tree
/
Copy pathdevicetestdataindex.cpp
More file actions
1570 lines (1282 loc) · 70.5 KB
/
Copy pathdevicetestdataindex.cpp
File metadata and controls
1570 lines (1282 loc) · 70.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#include "devicetestdataindex.h"
#include "deviceindex.h"
#include "bluetooth.h"
#include "devicenamepatterngroup.h"
#include "bluetoothdevicetestdata.h"
#include "bluetoothdevicetestdatabuilder.h"
#include "devicediscoveryinfo.h"
#include "qzsettings.h"
bool DeviceTestDataIndex::isInitialized = false;
/**
* @brief hex2bytes Converts a hexadecimal string to bytes, 2 characters at a time.
* @param s An hexadecimal string e.g. "023F4A" to { 0x02, 0x3F, 0x4A }
*/
static QByteArray hex2bytes(const std::string& s)
{
QByteArray v;
for (size_t i = 0; i < s.length(); i +=2)
{
std::string slice(s, i, 2);
uint8_t value = std::stoul(slice, 0, 16);
v.append(value);
}
return v;
}
QMap<QString,const BluetoothDeviceTestData*> DeviceTestDataIndex::testData;
const std::vector<QString> DeviceTestDataIndex::Names() {
std::vector<QString> result;
for(auto key : testData.keys())
result.push_back(key);
return result;
}
const std::vector<const BluetoothDeviceTestData *> DeviceTestDataIndex::TestData() {
std::vector<const BluetoothDeviceTestData*> result;
for(auto item : testData)
result.push_back(item);
return result;
}
BluetoothDeviceTestDataBuilder * DeviceTestDataIndex::RegisterNewDeviceTestData(const QString& name)
{
auto existing = testData.value(name, nullptr);
if(existing)
delete existing;
BluetoothDeviceTestDataBuilder * result = new BluetoothDeviceTestDataBuilder(name);
testData.insert(name, result);
return result;
}
const BluetoothDeviceTestData *DeviceTestDataIndex::GetTestData(const QString &name) {
if(!isInitialized)
throw std::invalid_argument("Device test data is not initialized.");
return testData.value(name, nullptr);
}
QMultiMap<DeviceTypeId, const BluetoothDeviceTestData*> DeviceTestDataIndex::WhereExpects(const std::unordered_set<DeviceTypeId> &typeIds) {
QMultiMap<DeviceTypeId, const BluetoothDeviceTestData*> result;
if(typeIds.empty())
return result;
for(auto item : qAsConst(testData)) {
if(typeIds.count(item->ExpectedDeviceType()))
result.insert(item->ExpectedDeviceType(), item);
}
return result;
}
void DeviceTestDataIndex::Initialize() {
if(isInitialized)
return;
const QString testIP = "1.2.3.4";
// Activio Treadmill
RegisterNewDeviceTestData(DeviceIndex::ActivioTreadmill)
->expectDevice<activiotreadmill>()
->acceptDeviceName("RUNNERT", DeviceNameComparison::StartsWithIgnoreCase);
// Apex Bike
RegisterNewDeviceTestData(DeviceIndex::ApexBike)
->expectDevice<apexbike>()
->acceptDeviceName("WLT8266BM", DeviceNameComparison::StartsWithIgnoreCase);
// Ant Bike
RegisterNewDeviceTestData(DeviceIndex::AntBike)
->expectDevice<antbike>()
->acceptDeviceName("", DeviceNameComparison::Exact)
->configureSettingsWith(QZSettings::antbike);
// BH Fitness Elliptical
RegisterNewDeviceTestData(DeviceIndex::BHFitnessElliptical)
->expectDevice<bhfitnesselliptical>()
->acceptDeviceName("B01_", DeviceNameComparison::StartsWithIgnoreCase);
// BKool Bike
RegisterNewDeviceTestData(DeviceIndex::BKoolBike)
->expectDevice<bkoolbike>()
->acceptDeviceName("BKOOLSMARTPRO", DeviceNameComparison::StartsWithIgnoreCase);
// Bowflex T216 Treadmill
RegisterNewDeviceTestData(DeviceIndex::BowflexT216Treadmill)
->expectDevice<bowflext216treadmill>()
->acceptDeviceName("BOWFLEX T", DeviceNameComparison::StartsWithIgnoreCase);
//// Bowflex Treadmill
//RegisterNewDeviceTestData(DeviceIndex::BowflexTreadmill)
//->expectDevice<bowflexttreadmill>();
// ChronoBike
RegisterNewDeviceTestData(DeviceIndex::Chronobike)
->expectDevice<chronobike>()
->acceptDeviceName("CHRONO ", DeviceNameComparison::StartsWithIgnoreCase);
// Computrainer Bike
RegisterNewDeviceTestData(DeviceIndex::ComputrainerBike)
->expectDevice<computrainerbike>()
->acceptDeviceName("", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(QZSettings::computrainer_serialport, "COMX", "");
// Concept2 Ski Erg
RegisterNewDeviceTestData(DeviceIndex::Concept2SkiErg)
->expectDevice<concept2skierg>()
->acceptDeviceName("PM5", "SKI", DeviceNameComparison::IgnoreCase)
->acceptDeviceName("PM5", DeviceNameComparison::IgnoreCase);
// Crossrope
RegisterNewDeviceTestData(DeviceIndex::Crossrope)
->expectDevice<crossrope>()
->acceptDeviceName("CROSSROPE", DeviceNameComparison::StartsWithIgnoreCase);
// CSC Bike (Named)
QString cscBikeName = "CyclingSpeedCadenceBike-";
RegisterNewDeviceTestData(DeviceIndex::CSCBike_Named)
->expectDevice<cscbike>()
->acceptDeviceName(cscBikeName, DeviceNameComparison::StartsWith)
->rejectDeviceName("X" + cscBikeName, DeviceNameComparison::Exact)
->configureSettingsWith([cscBikeName](DeviceDiscoveryInfo &info, bool enable) -> void {
info.setValue(QZSettings::cadence_sensor_name, enable ? cscBikeName : "Disabled");
info.setValue(QZSettings::cadence_sensor_as_bike, enable);
});
// CSafe Rower
RegisterNewDeviceTestData(DeviceIndex::CSafeRower)
->expectDevice<csaferower>()
->acceptDeviceName("", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(QZSettings::csafe_rower, "COMX", "");
// CSafe Elliptical
RegisterNewDeviceTestData(DeviceIndex::CSafeElliptical)
->expectDevice<csafeelliptical>()
->acceptDeviceName("", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(QZSettings::csafe_elliptical_port, "COMX", "");
cscBikeName = "CyclingSpeedCadenceBike-";
RegisterNewDeviceTestData(DeviceIndex::CSCBike)
->expectDevice<cscbike>()
->acceptDeviceName(QStringLiteral("JOROTO-BK-"), DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(
[cscBikeName](const DeviceDiscoveryInfo &info, bool enable, std::vector<DeviceDiscoveryInfo> &configurations)->void
{
DeviceDiscoveryInfo config(info);
if(enable) {
// If the Bluetooth name doesn't match the one being tested, but if csc_as_bike is enabled in the settings,
// and the bluetooth name does match the cscName in the settings, the device will be detected anyway,
// so prevent this by not including that specific configuration
//
// In order for the search to actually happen, the cscName has to be "Disabled" or csc_as_bike must be true.
/*
config.setValue(QZSettings::csc_as_bike, true);
config.setValue(QZSettings::cscName, cscBikeName);
configurations.push_back(config);
*/
config.setValue(QZSettings::cadence_sensor_name, "Disabled");
config.setValue(QZSettings::cadence_sensor_as_bike, true);
configurations.push_back(config);
config.setValue(QZSettings::cadence_sensor_name, "Disabled");
config.setValue(QZSettings::cadence_sensor_as_bike, false);
configurations.push_back(config);
config.setValue(QZSettings::cadence_sensor_as_bike, true);
config.setValue(QZSettings::cadence_sensor_name,"NOT "+cscBikeName);
configurations.push_back(config);
}
else {
// prevent the search
config.setValue(QZSettings::cadence_sensor_as_bike, false);
config.setValue(QZSettings::cadence_sensor_name, "NOT "+cscBikeName);
configurations.push_back(config);
}
});
// Cyclops Phantom Bike
RegisterNewDeviceTestData(DeviceIndex::CyclopsPhantomBike)
->expectDevice<cycleopsphantombike>()
->acceptDeviceName("INDOORCYCLE", DeviceNameComparison::StartsWithIgnoreCase);
// DeerRun Treadmill
RegisterNewDeviceTestData(DeviceIndex::DeerRunTreadmill)
->expectDevice<deerruntreadmill>()
->acceptDeviceName("PITPAT-T", DeviceNameComparison::StartsWithIgnoreCase);
// Domyos bike
RegisterNewDeviceTestData(DeviceIndex::DomyosBike)
->expectDevice<domyosbike>()
->acceptDeviceName("Domyos-Bike", DeviceNameComparison::StartsWith)
->rejectDeviceName("DomyosBridge", DeviceNameComparison::StartsWith)
->configureSettingsWith([](const DeviceDiscoveryInfo& info, bool enable, std::vector<DeviceDiscoveryInfo>& configurations)->void{
DeviceDiscoveryInfo config(info);
if(enable) {
// has service and both values of domyosbike_notftms
config.includeBluetoothService(QBluetoothUuid((quint16)0x1826), false);
config.setValue(QZSettings::domyosbike_notfmts, true);
configurations.push_back(config);
config.setValue(QZSettings::domyosbike_notfmts, false);
configurations.push_back(config);
config.includeBluetoothService(QBluetoothUuid((quint16)0x1826), true);
config.setValue(QZSettings::domyosbike_notfmts, true);
configurations.push_back(config);
} else {
config.includeBluetoothService(QBluetoothUuid((quint16)0x1826), true);
config.setValue(QZSettings::domyosbike_notfmts, false);
configurations.push_back(config);
}
});
// DomyosElliptical
RegisterNewDeviceTestData(DeviceIndex::DomyosElliptical)
->expectDevice<domyoselliptical>()
->acceptDeviceName("Domyos-EL", DeviceNameComparison::StartsWith)
->rejectDeviceName("DomyosBridge",DeviceNameComparison::StartsWith);
// Domyos rower
RegisterNewDeviceTestData(DeviceIndex::DomyosRower)
->expectDevice<domyosrower>()
->acceptDeviceName("DOMYOS-ROW", DeviceNameComparison::StartsWithIgnoreCase)
->rejectDeviceName("DomyosBridge", DeviceNameComparison::StartsWith);
// Domyos Treadmill
RegisterNewDeviceTestData(DeviceIndex::DomyosTreadmill)
->expectDevice<domyostreadmill>()
->acceptDeviceName("Domyos", DeviceNameComparison::StartsWith)
->rejectDeviceName("DomyosBr", DeviceNameComparison::StartsWith)
->rejectDeviceName("DOMYOS-BIKING-", DeviceNameComparison::StartsWith)
->excluding<domyoselliptical>()
->excluding<domyosbike>()
->excluding<domyosrower>()
->excluding<horizontreadmill>()
->excluding<ftmsbike>()
->configureSettingsWith([](const DeviceDiscoveryInfo& info, bool enable, std::vector<DeviceDiscoveryInfo>& configurations) {
DeviceDiscoveryInfo result(info);
auto service = QBluetoothUuid((quint16)0x1826);
// Enabled means the device name isn't the value of the ftms_treadmill setting
result.setValue(QZSettings::ftms_treadmill, "NOT " + result.DeviceInfo()->name());
// Doesn't have 0x1826 but domyostreadmill_notfmts is default
result.removeBluetoothService(service);
result.setValue(QZSettings::domyostreadmill_notfmts, true);
configurations.push_back(result);
result.setValue(QZSettings::domyostreadmill_notfmts, false);
configurations.push_back(result);
// Does have 0x1826 and domyostreadmill_notfmts is default
result.addBluetoothService(service);
result.setValue(QZSettings::domyostreadmill_notfmts, true);
result.setValue(QZSettings::ftms_treadmill, "NOT " + result.DeviceInfo()->name());
configurations.push_back(result);
if(!enable) {
// Disable the "enabling" configurations using the name
for(auto& config : configurations)
config.setValue(QZSettings::ftms_treadmill, config.DeviceInfo()->name()); // TODO: do something to check case insensitivity
// Has 0x1826 and domyostreadmill_notfmts is not default
result.addBluetoothService(service);
result.setValue(QZSettings::domyostreadmill_notfmts, false);
result.setValue(QZSettings::ftms_treadmill, result.DeviceInfo()->name());
configurations.push_back(result);
result.addBluetoothService(service);
result.setValue(QZSettings::domyostreadmill_notfmts, false);
result.setValue(QZSettings::ftms_treadmill, "NOT " + result.DeviceInfo()->name());
configurations.push_back(result);
}
});
// Echelon Connect Sport Bike
RegisterNewDeviceTestData(DeviceIndex::EchelonConnectSportBike)
->expectDevice<echelonconnectsport>()
->acceptDeviceName("ECH", DeviceNameComparison::StartsWith)
->excluding<echelonrower>()
->excluding<echelonstride>();
// Echelon Rower
RegisterNewDeviceTestData(DeviceIndex::EchelonRower)
->expectDevice<echelonrower>()
->acceptDeviceName("ECH-ROW", DeviceNameComparison::StartsWith)
->acceptDeviceName("ROWSPORT-", DeviceNameComparison::StartsWithIgnoreCase)
->acceptDeviceName("ROW-S", DeviceNameComparison::StartsWith);
// Echelon Stride Treadmill
RegisterNewDeviceTestData(DeviceIndex::EchelonStrideTreadmill)
->expectDevice<echelonstride>()
->acceptDeviceName("ECH-STRIDE", DeviceNameComparison::StartsWithIgnoreCase)
->acceptDeviceName("ECH-UK-", DeviceNameComparison::StartsWithIgnoreCase)
->acceptDeviceName("ECH-SD-SPT", DeviceNameComparison::StartsWithIgnoreCase);
// TODO: check if this is actually used
// Elite Sterzo Smart
RegisterNewDeviceTestData(DeviceIndex::EliteSterzoSmart)
->expectDevice<elitesterzosmart>()
->disable("Unable to detect with current logic");
// ES Linker Treadmill
RegisterNewDeviceTestData(DeviceIndex::ESLinkerTreadmill)
->expectDevice<eslinkertreadmill>()
->acceptDeviceName("ESLINKER", DeviceNameComparison::StartsWithIgnoreCase);
// Fake Bike
RegisterNewDeviceTestData(DeviceIndex::FakeBike)
->expectDevice<fakebike>()
->acceptDeviceName("", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(QZSettings::applewatch_fakedevice);
// Fake Elliptical
RegisterNewDeviceTestData(DeviceIndex::FakeElliptical)
->expectDevice<fakeelliptical>()
->acceptDeviceName("", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(QZSettings::fakedevice_elliptical);
// Fake Rower
RegisterNewDeviceTestData(DeviceIndex::FakeRower)
->expectDevice<fakerower>()
->acceptDeviceName("", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(QZSettings::fakedevice_rower);
// Fake Treadmill
RegisterNewDeviceTestData(DeviceIndex::FakeTreadmill)
->expectDevice<faketreadmill>()
->acceptDeviceName("", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(QZSettings::fakedevice_treadmill);
// FitPlus F5
RegisterNewDeviceTestData(DeviceIndex::FitPlusF5)
->expectDevice<fitplusbike>()
->acceptDeviceName("FS-", DeviceNameComparison::StartsWith)
->configureSettingsWith( QZSettings::fitplus_bike);
// VirtuFit Etappe 2.0i
RegisterNewDeviceTestData(DeviceIndex::FitPlusVirtufitEtappeX100)
->expectDevice<fitplusbike>()
->acceptDeviceName("X100-", DeviceNameComparison::StartsWith);
// FitPlus MRK
RegisterNewDeviceTestData(DeviceIndex::FitPlusBike_MRK_NoSettings)
->expectDevice<fitplusbike>()
->acceptDeviceName("MRK-", DeviceNameComparison::StartsWith)
->excluding<ftmsbike>()
->excluding<snodebike>();
// FitShow FS
RegisterNewDeviceTestData(DeviceIndex::FitShowFS)
->expectDevice<fitshowtreadmill>()
->acceptDeviceName("FS-", DeviceNameComparison::StartsWith)
->configureSettingsWith(
[](const DeviceDiscoveryInfo& info, bool enable, std::vector<DeviceDiscoveryInfo>& configurations) -> void
{
DeviceDiscoveryInfo config(info);
if(enable){
config.setValue(QZSettings::snode_bike, false);
config.setValue(QZSettings::fitplus_bike, false);
config.setValue(QZSettings::hammer_racer_s, false);
config.setValue(QZSettings::iconsole_elliptical, false);
config.setValue(QZSettings::gymstick_gx6_0_elliptical, false);
config.setValue(QZSettings::virtufit_etappe, false);
configurations.push_back(config);
} else {
config.setValue(QZSettings::snode_bike, true);
config.setValue(QZSettings::fitplus_bike, false);
config.setValue(QZSettings::hammer_racer_s, false);
config.setValue(QZSettings::iconsole_elliptical, false);
config.setValue(QZSettings::gymstick_gx6_0_elliptical, false);
config.setValue(QZSettings::virtufit_etappe, false);
configurations.push_back(config);
config.setValue(QZSettings::snode_bike, false);
config.setValue(QZSettings::fitplus_bike, true);
configurations.push_back(config);
config.setValue(QZSettings::fitplus_bike, false);
config.setValue(QZSettings::virtufit_etappe, true);
configurations.push_back(config);
config.setValue(QZSettings::virtufit_etappe, false);
config.setValue(QZSettings::hammer_racer_s, true);
configurations.push_back(config);
config.setValue(QZSettings::hammer_racer_s, false);
config.setValue(QZSettings::iconsole_elliptical, true);
configurations.push_back(config);
config.setValue(QZSettings::iconsole_elliptical, false);
config.setValue(QZSettings::gymstick_gx6_0_elliptical, true);
configurations.push_back(config);
}
})
->excluding<ftmsbike>();
// FitShow TR510-T
RegisterNewDeviceTestData(DeviceIndex::FitShowTR510T)
->expectDevice<fitshowtreadmill>()
->acceptDeviceName("TR510-T", DeviceNameComparison::StartsWithIgnoreCase);
// FitShow SW
RegisterNewDeviceTestData(DeviceIndex::FitShowSW)
->expectDevice<fitshowtreadmill>()
// SW, 14 characters total
->acceptDeviceName("SW345678901234", DeviceNameComparison::Exact)
->acceptDeviceName("SWFOURTEENCHAR", DeviceNameComparison::Exact)
->acceptDeviceName("WINFITA", DeviceNameComparison::StartsWithIgnoreCase)
->acceptDeviceName("NOBLEPRO CONNECT", DeviceNameComparison::StartsWithIgnoreCase)
// too long and too short
->rejectDeviceName("SW3456789012345", DeviceNameComparison::Exact)
->rejectDeviceName("SW34567890123", DeviceNameComparison::Exact);
// FitShow BF
RegisterNewDeviceTestData(DeviceIndex::FitShowBF)
->expectDevice<fitshowtreadmill>()
->acceptDeviceName("BF70", DeviceNameComparison::StartsWith);
// Flywheel Bike
RegisterNewDeviceTestData(DeviceIndex::FlywheelBike)
->expectDevice<flywheelbike>()
->acceptDeviceName("Flywheel", DeviceNameComparison::StartsWith);
// Flywheel Life Fitness IC8
RegisterNewDeviceTestData(DeviceIndex::FlywheelLifeFitnessIC8)
->expectDevice<flywheelbike>()
->acceptDeviceName("BIKE", DeviceNameComparison::StartsWithIgnoreCase, 6)
->configureSettingsWith(QZSettings::flywheel_life_fitness_ic8);
// Focus Treadmill
RegisterNewDeviceTestData(DeviceIndex::FocusTreadmill)
->expectDevice<focustreadmill>()
->acceptDeviceName("EW-TM-", DeviceNameComparison::StartsWithIgnoreCase);
// FTMS Bike general
auto ftmsBikeConfigureExclusions = {
DeviceTestDataIndex::GetTypeId<snodebike>(),
DeviceTestDataIndex::GetTypeId<fitplusbike>(),
DeviceTestDataIndex::GetTypeId<stagesbike>()
};
// FTMS Bike Hammer Racer S
RegisterNewDeviceTestData(DeviceIndex::FTMSBikeHammerRacerS)
->expectDevice<ftmsbike>()
->acceptDeviceName("FS-", DeviceNameComparison::StartsWith)
->configureSettingsWith(QZSettings::hammer_racer_s)
->excluding(ftmsBikeConfigureExclusions);
// FTMS Bike Hammer 64123
RegisterNewDeviceTestData(DeviceIndex::FTMSBikeHammer)
->expectDevice<ftmsbike>()
->acceptDeviceName("HAMMER ", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(
[](const DeviceDiscoveryInfo &info, bool enable, std::vector<DeviceDiscoveryInfo> &configurations) -> void
{
DeviceDiscoveryInfo config(info);
if (enable) {
config.setValue(QZSettings::power_sensor_as_bike, false);
config.setValue(QZSettings::saris_trainer, false);
configurations.push_back(config);
} else {
for(int x = 1; x<=3; x++) {
config.setValue(QZSettings::power_sensor_as_bike, x & 1);
config.setValue(QZSettings::saris_trainer, x & 2);
configurations.push_back(config);
}
}})
->excluding(ftmsBikeConfigureExclusions);
// FTMS Bike IConsole
RegisterNewDeviceTestData(DeviceIndex::FTMSBikeIConsole)
->expectDevice<ftmsbike>()
->acceptDeviceName("ICONSOLE+", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(QZSettings::toorx_ftms)
->excluding(ftmsBikeConfigureExclusions);
// FTMS Bike
QStringList acceptableFTMSNames {
"DHZ-", // JK fitness 577
"MKSM", // MKSM3600036
"YS_C1_", // Yesoul C1H
"YS_G1_", // Yesoul S3
"YS_G1MPLUS", // Yesoul G1M Plus
"DS25-", // Bodytone DS25
"SCHWINN 510T",
"3G CARDIO ",
"ZWIFT HUB",
"FLXCY-", // Pro FlexBike
"QB-WC01", // Nexgim QB-C01 smart bike
"XBR55",
"ECHO_BIKE_",
"EW-JS-",
"MERACH-MR667-",
"DS60-",
"SPAX-BK-",
"YSV1",
"VICTORY",
"CECOTEC", // Cecotec DrumFit Indoor 10000 MagnoMotor Connected #2420
"WATTBIKE",
"ZYCLEZBIKE",
"WAVEFIT-",
"KETTLERBLE",
"JAS_C3",
"SCH_190U",
"RAVE WHITE",
"DOMYOS-BIKING-",
"DU30-",
"BIKZU_",
"WLT8828",
"VANRYSEL-HT",
"HARISON-X15",
"FEIVON V2",
"FELVON V2",
"ZUMO",
"JUSTO",
"T2 ",
"VFSPINBIKE",
"XS08-",
"B94",
"STAGES BIKE",
"SUITO",
"D2RIDE",
"DIRETO X",
"MERACH-667-",
"MRK-S26S-",
"MRK-S26C-",
"MRK-S28-",
"MRK-S38-",
"SMB1",
"UBIKE FTMS",
"INRIDE"
};
RegisterNewDeviceTestData(DeviceIndex::FTMSBike)
->expectDevice<ftmsbike>()
->acceptDeviceNames(acceptableFTMSNames, DeviceNameComparison::StartsWithIgnoreCase)
->acceptDeviceName("DI", DeviceNameComparison::StartsWithIgnoreCase, 2) // Elite smart trainer #1682)
->acceptDeviceName("YSV", DeviceNameComparison::StartsWithIgnoreCase, 9) // YSV100783
->acceptDeviceName("URSB", DeviceNameComparison::StartsWithIgnoreCase, 7) // URSB005
->acceptDeviceName("DBF", DeviceNameComparison::StartsWithIgnoreCase, 6) // DBF135
->acceptDeviceName("KSU", DeviceNameComparison::StartsWithIgnoreCase, 7) // KSU1102
->acceptDeviceName("VOLT", DeviceNameComparison::StartsWithIgnoreCase, 4)
->acceptDeviceName("XQ0201118141", DeviceNameComparison::IgnoreCase)
->acceptDeviceName("F","ARROW",DeviceNameComparison::IgnoreCase) // FI9110 Arrow, https://www.fitnessdigital.it/bicicletta-smart-bike-ion-fitness-arrow-connect/p/10022863/ IO Fitness Arrow
->acceptDeviceName("ICSE", DeviceNameComparison::StartsWithIgnoreCase, 4)
->acceptDeviceName("FLX", DeviceNameComparison::StartsWithIgnoreCase, 10)
->acceptDeviceName("CSRB", DeviceNameComparison::StartsWithIgnoreCase, 11)
// Starts with DT- and is 14+ characters long.
// TODO: update once addDeviceName can generate valid and invalid names for variable length patterns
->acceptDeviceName("DT-0123456789A", DeviceNameComparison::IgnoreCase) // Sole SB700
->acceptDeviceName("DT-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", DeviceNameComparison::IgnoreCase) // Sole SB700
->rejectDeviceName("DT-0123456789", DeviceNameComparison::IgnoreCase) // too short for Sole SB700
->rejectDeviceName("DBF13", DeviceNameComparison::IgnoreCase) // too short for DBF135
->rejectDeviceName("DBF1355", DeviceNameComparison::IgnoreCase) // too long for DBF135
->rejectDeviceName("XQ020111814", DeviceNameComparison::IgnoreCase)
->rejectDeviceName("XQ02ABC18141", DeviceNameComparison::IgnoreCase)
->rejectDeviceName("XQ02011181411", DeviceNameComparison::IgnoreCase)
->excluding(ftmsBikeConfigureExclusions);
// FTMS Accessory
QString ftmsAccessoryName = "accessory";
RegisterNewDeviceTestData(DeviceIndex::FTMSAccessory)
->expectDevice<ftmsbike>()
->acceptDeviceName(ftmsAccessoryName, DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(
[ftmsAccessoryName](DeviceDiscoveryInfo& info, bool enable)->void
{
info.setValue(QZSettings::ss2k_peloton, enable);
info.setValue(QZSettings::ftms_accessory_name, enable ? ftmsAccessoryName : "NOT " + ftmsAccessoryName );
})
->excluding(ftmsBikeConfigureExclusions);
// FTMS "BIKE-"
RegisterNewDeviceTestData(DeviceIndex::FTMSBike3)
->expectDevice<ftmsbike>()
->acceptDeviceName("BIKE-", DeviceNameComparison::StartsWithIgnoreCase)
->excluding(ftmsBikeConfigureExclusions)
->configureSettingsWith([](const DeviceDiscoveryInfo& info, bool enable, std::vector<DeviceDiscoveryInfo>& configurations) -> void {
if(!enable)
return;
DeviceDiscoveryInfo config(info);
// distinguish from npecablebike
config.setValue(QZSettings::flywheel_life_fitness_ic8, true);
configurations.push_back(config);
});
// FTMS Bike 2
RegisterNewDeviceTestData(DeviceIndex::FTMSBike2)
->expectDevice<ftmsbike>()
->acceptDeviceNames({"GLT",
"SPORT01-"}, // Labgrey Magnetic Exercise Bike https://www.amazon.co.uk/dp/B0CXMF1NPY?_encoding=UTF8&psc=1&ref=cm_sw_r_cp_ud_dp_PE420HA7RD7WJBZPN075&ref_=cm_sw_r_cp_ud_dp_PE420HA7RD7WJBZPN075&social_share=cm_sw_r_cp_ud_dp_PE420HA7RD7WJBZPN075&skipTwisterOG=1,
DeviceNameComparison::StartsWithIgnoreCase)
->excluding(ftmsBikeConfigureExclusions)
->configureSettingsWith(QBluetoothUuid((quint16)0x1826));
// FTMS Bike Horizon 5.0R
RegisterNewDeviceTestData(DeviceIndex::FTMSBikeHorizon5R)
->expectDevice<ftmsbike>()
->acceptDeviceName("JFBK5.0R", DeviceNameComparison::IgnoreCase)
->excluding(ftmsBikeConfigureExclusions);
// FTMS Rower
RegisterNewDeviceTestData(DeviceIndex::FTMSRower)
->expectDevice<ftmsrower>()
->acceptDeviceNames({"CR 00","KAYAKPRO","WHIPR", "KS-WLT", "I-ROWER", "S4 COMMS"}, DeviceNameComparison::StartsWithIgnoreCase)
->acceptDeviceNames({"PM5ROW","PM5XROW","SF-RW"}, DeviceNameComparison::IgnoreCase);
// Horizon GR7 Bike
RegisterNewDeviceTestData(DeviceIndex::HorizonGR7Bike)
->expectDevice<horizongr7bike>()
->acceptDeviceName("JFIC", DeviceNameComparison::StartsWithIgnoreCase);
// TODO: revisit
// Horizon Treadmill
RegisterNewDeviceTestData(DeviceIndex::HorizonTreadmill)
->expectDevice<horizontreadmill>()
->acceptDeviceNames({"HORIZON","AFG SPORT","WLT2541"}, DeviceNameComparison::StartsWithIgnoreCase)
->acceptDeviceNames(
// FTMS
{"T318_", "T218_", "TRX3500", "JFTMPARAGON", "PARAGON X", "JFTM", "CT800",
"MOBVOI TM", "DK202000725", "CTM780102C6BB32D62", "MX-TM ", "MATRIXTF50", "MOBVOI TM",
"KETTLER TREADMILL", "ASSAULTRUNNER"}, DeviceNameComparison::StartsWithIgnoreCase);
// Horizon Treadmill (Toorx)
RegisterNewDeviceTestData(DeviceIndex::HorizonTreadmill_Toorx)
->expectDevice<horizontreadmill>()
->acceptDeviceName("TOORX", DeviceNameComparison::StartsWithIgnoreCase)
->acceptDeviceName("I-CONSOLE+", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(
[](const DeviceDiscoveryInfo &info, bool enable, std::vector<DeviceDiscoveryInfo> &configurations) -> void
{
DeviceDiscoveryInfo config(info);
if (enable) {
config.setValue(QZSettings::toorx_ftms_treadmill, true);
config.setValue(QZSettings::toorx_ftms, false);
configurations.push_back(config);
} else {
// Basic case where the device is disabled in the settings
config.setValue(QZSettings::toorx_ftms_treadmill, false);
config.setValue(QZSettings::toorx_ftms, false);
configurations.push_back(config);
// Basic case where the device is disabled in the settings and has an excluding settings
config.setValue(QZSettings::toorx_ftms_treadmill, false);
config.setValue(QZSettings::toorx_ftms, true);
configurations.push_back(config);
// Enabled in settings, but with excluding setting
config.setValue(QZSettings::toorx_ftms_treadmill, true);
config.setValue(QZSettings::toorx_ftms, true);
configurations.push_back(config);
}
});
// Horizon Treadmill (Bodytone)
RegisterNewDeviceTestData(DeviceIndex::HorizonTreadmill_Bodytone)
->expectDevice<horizontreadmill>()
->acceptDeviceName("TF-", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(QZSettings::horizon_treadmill_force_ftms);
// Horizon Treadmill (Domyos TC)
RegisterNewDeviceTestData(DeviceIndex::HorizonTreadmill_DomyosTC)
->expectDevice<horizontreadmill>()
->acceptDeviceName("DOMYOS-TC", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith([](DeviceDiscoveryInfo& info, bool enable) -> void {
info.setValue(QZSettings::domyostreadmill_notfmts, !enable);
info.includeBluetoothService(QBluetoothUuid((quint16)0x1826), enable);
});
// iConcept Bike
RegisterNewDeviceTestData(DeviceIndex::iConceptBike)
->expectDevice<iconceptbike>()
->acceptDeviceName("BH DUALKIT", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(QZSettings::iconcept_elliptical, false);
// iConcept Elliptical
RegisterNewDeviceTestData(DeviceIndex::iConceptElliptical)
->expectDevice<iconceptelliptical>()
->acceptDeviceName("BH DUALKIT", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(QZSettings::iconcept_elliptical);
// Inspire Bike
RegisterNewDeviceTestData(DeviceIndex::InspireBike)
->expectDevice<inspirebike>()
->acceptDeviceName("IC", DeviceNameComparison::StartsWithIgnoreCase, 8);
// Keep Bike
RegisterNewDeviceTestData(DeviceIndex::KeepBike)
->expectDevice<keepbike>()
->acceptDeviceName("KEEP_BIKE_", DeviceNameComparison::StartsWithIgnoreCase);
// Kingsmith R1 Pro Treadmill
RegisterNewDeviceTestData(DeviceIndex::KingsmithR1ProTreadmill)
->expectDevice<kingsmithr1protreadmill>()
->acceptDeviceName("RE", DeviceNameComparison::IgnoreCase)
->acceptDeviceNames({"R1 PRO",
"KINGSMITH",
"KS-H",
"KS-BLC", // Walkingpad C2 #1672
"DYNAMAX",
"WALKINGPAD",
"KS-BLR", // Treadmill KingSmith WalkingPad R2 Pro KS-HCR1AA
"KS-ST-A1P", // KingSmith Walkingpad A1 Pro #2041
// Poland-distributed WalkingPad R2 TRR2FB
"KS-SC-BLR2C",
}, DeviceNameComparison::StartsWithIgnoreCase)
->rejectDeviceName("KS-HD-Z1D", DeviceNameComparison::StartsWithIgnoreCase) // it's an FTMS one
->excluding<kingsmithr2treadmill>();
// Kingsmith R2 Treadmill
RegisterNewDeviceTestData(DeviceIndex::KingsmithR2Treadmill)
->expectDevice<kingsmithr2treadmill>()
->acceptDeviceName("KS-ST-K12PRO", DeviceNameComparison::StartsWithIgnoreCase)
// KingSmith Walking Pad R2
->acceptDeviceNames({"KS-R1AC","KS-HC-R1AA","KS-HC-R1AC"}, DeviceNameComparison::StartsWithIgnoreCase)
// KingSmith Walking Pad X21
->acceptDeviceNames({"KS-X21", "KS-HDSC-X21C","KS-HDSY-X21C","KS-NGCH-X21C","KS-NACH-X21C"}, DeviceNameComparison::StartsWithIgnoreCase)
// KingSmith Walking Pad G1
->acceptDeviceName("KS-NGCH-G1C", DeviceNameComparison::StartsWithIgnoreCase);
// Life Fitness Treadmill
RegisterNewDeviceTestData(DeviceIndex::LifeFitnessTreadmill)
->expectDevice<lifefitnesstreadmill>()
->acceptDeviceName("LF", DeviceNameComparison::StartsWithIgnoreCase, 18);
// M3I Bike
RegisterNewDeviceTestData(DeviceIndex::M3IBike)
->expectDevice<m3ibike>()
->acceptDeviceName("M3", DeviceNameComparison::StartsWith)
->configureSettingsWith(
[](DeviceDiscoveryInfo& info, bool enable)->void
{
// The M3I bike detector looks into the manufacturer data.
if(!enable) {
info.DeviceInfo()->setManufacturerData(1, QByteArray("Invalid manufacturer data."));
return;
}
int key=0;
info.DeviceInfo()->setManufacturerData(key++, hex2bytes("02010639009F00000000000000000014008001"));
/*
// more data that has been supplied
result.setManufacturerData(key++, hex2bytes("02010639009F00000000000000000014008001"));
result.setManufacturerData(key++, hex2bytes("02010639009FBA000000020000000014008001"));
result.setManufacturerData(key++, hex2bytes("02010639009FBA000000020000000013008001"));
result.setManufacturerData(key++, hex2bytes("02010639009FBA000000020000000013008001"));
result.setManufacturerData(key++, hex2bytes("02010639009FBA000000020000000012008001"));
result.setManufacturerData(key++, hex2bytes("02010639009FBA000000020000000012008001"));
result.setManufacturerData(key++, hex2bytes("02010639009FBA000000000000000011008001"));
result.setManufacturerData(key++, hex2bytes("02010639009FBC000000020000000010008001"));
result.setManufacturerData(key++, hex2bytes("02010639009FBC000000020000000010008001"));
result.setManufacturerData(key++, hex2bytes("02010639009FBC00000002000000000F008001"));
result.setManufacturerData(key++, hex2bytes("02010639009FBC00000002000000000F008001"));
result.setManufacturerData(key++, hex2bytes("02010639009FBC00000002000000000E008001"));
result.setManufacturerData(key++, hex2bytes("02010639009FBC00000002000000000E008001"));
result.setManufacturerData(key++, hex2bytes("02010639009F0000000003000000000C000001"));
result.setManufacturerData(key++, hex2bytes("02010639009FDD00000003000000000C000001"));
result.setManufacturerData(key++, hex2bytes("02010639009FDD00000003000000000C000001"));
result.setManufacturerData(key++, hex2bytes("02010639009FDD00000003000000000B000001"));
result.setManufacturerData(key++, hex2bytes("02010639009FDD00000003000000000B000001"));
result.setManufacturerData(key++, hex2bytes("02010639009FDD00000003000000000B000001"));
result.setManufacturerData(key++, hex2bytes("02010639009FDD00000003000000000A000001"));
result.setManufacturerData(key++, hex2bytes("02010639009FDD00000003000000000A000001"));
result.setManufacturerData(key++, hex2bytes("02010639009F0000000000000000000A000001"));
result.setManufacturerData(key++, hex2bytes("02010639009FE8000000030000000009000001"));
result.setManufacturerData(key++, hex2bytes("02010639009FE8000000030000000009000001"));
result.setManufacturerData(key++, hex2bytes("02010639009FE8000000030000000009000001"));
result.setManufacturerData(key++, hex2bytes("02010639009FE8000000030000000008000001"));
result.setManufacturerData(key++, hex2bytes("02010639009FE8000000030000000008000001"));
result.setManufacturerData(key++, hex2bytes("02010639009FE8000000030000000008000001"));
result.setManufacturerData(key++, hex2bytes("02010639009FE8000000030000000007000001"));
result.setManufacturerData(key++, hex2bytes("02010639009FE8000000030000000000000001"));
result.setManufacturerData(key++, hex2bytes("02010639009FD3000000030000000000000001"));
result.setManufacturerData(key++, hex2bytes("02010639009FD3000000030000000000000001"));
result.setManufacturerData(key++, hex2bytes("02010639009FD3000000030000000000000001"));
result.setManufacturerData(key++, hex2bytes("02010639009FD3000000030000000000000001"));
*/
});
// MCF Bike
RegisterNewDeviceTestData(DeviceIndex::MCFBike)
->expectDevice<mcfbike>()
->acceptDeviceName("MCF-", DeviceNameComparison::StartsWithIgnoreCase);
// Mepanel Bike
RegisterNewDeviceTestData(DeviceIndex::MepanelBike)
->expectDevice<mepanelbike>()
->acceptDeviceName("MEPANEL", DeviceNameComparison::StartsWithIgnoreCase);
// Nautilus Bike
RegisterNewDeviceTestData(DeviceIndex::NautilusBike)
->expectDevice<nautilusbike>()
->acceptDeviceName("NAUTILUS B", DeviceNameComparison::StartsWithIgnoreCase);
// Nautilus Elliptical
RegisterNewDeviceTestData(DeviceIndex::NautilusElliptical)
->expectDevice<nautiluselliptical>()
->acceptDeviceNames({"NAUTILUS E", "NAUTILUS M"}, DeviceNameComparison::StartsWithIgnoreCase);
// Nautilus Treadmill
RegisterNewDeviceTestData(DeviceIndex::NautilusTreadmill)
->expectDevice<nautilustreadmill>()
->acceptDeviceName("NAUTILUS T", DeviceNameComparison::StartsWithIgnoreCase);
// Norditrack Elliptical
RegisterNewDeviceTestData(DeviceIndex::NorditrackElliptical)
->expectDevice<nordictrackelliptical>()
->acceptDeviceName("I_EL", DeviceNameComparison::StartsWithIgnoreCase);
// Nordictrack IFit ADB Bike
RegisterNewDeviceTestData(DeviceIndex::NordictrackIFitADBBike)
->expectDevice<nordictrackifitadbbike>()
->acceptDeviceName("", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(QZSettings::tdf_10_ip, testIP, "");
// Nordictrack IFit ADB Elliptical
RegisterNewDeviceTestData(DeviceIndex::NordictrackIFitADBElliptical)
->expectDevice<nordictrackifitadbelliptical>()
->acceptDeviceName("", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(QZSettings::proform_elliptical_ip, testIP, "");
// Nordictrack IFit ADB Treadmill
RegisterNewDeviceTestData(DeviceIndex::NordictrackIFitADBTreadmill)
->expectDevice<nordictrackifitadbtreadmill>()
->acceptDeviceName("", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(QZSettings::nordictrack_2950_ip, testIP, "");
// NPE Cable Bike
RegisterNewDeviceTestData(DeviceIndex::NPECableBike)
->expectDevice<npecablebike>()
->acceptDeviceName(">CABLE", DeviceNameComparison::StartsWithIgnoreCase)
->acceptDeviceName("MD", DeviceNameComparison::StartsWithIgnoreCase, 7)
->configureSettingsWith(QZSettings::flywheel_life_fitness_ic8, false);
// NPE Cable Bike
RegisterNewDeviceTestData(DeviceIndex::NPECableBike)
->expectDevice<npecablebike>()
->acceptDeviceName(">CABLE", DeviceNameComparison::StartsWithIgnoreCase)
->acceptDeviceName("MD", DeviceNameComparison::StartsWithIgnoreCase, 7);
// NPE Cable Bike (excluding Flywheel Life Fitness IC8)
RegisterNewDeviceTestData(DeviceIndex::NPECableBike_Excluding_FlywheelLifeFitnessIC8)
->expectDevice<npecablebike>()
// BIKE 1, BIKE 2, BIKE 3...
->acceptDeviceName("BIKE", DeviceNameComparison::StartsWithIgnoreCase, 6)
// put in a name that's too long.
->rejectDeviceName("BIKE567", DeviceNameComparison::IgnoreCase)
->configureSettingsWith(QZSettings::flywheel_life_fitness_ic8, false /* don't allow this device if the Flywheel bike is enabled. */);
// Octane Elliptical
RegisterNewDeviceTestData(DeviceIndex::OctaneElliptical)
->expectDevice<octaneelliptical>()
->acceptDeviceName("Q37", DeviceNameComparison::StartsWithIgnoreCase);
// Octane Elliptical
RegisterNewDeviceTestData(DeviceIndex::OctaneTreadmill)
->expectDevice<octanetreadmill>()
->acceptDeviceNames({"ZR7", "ZR8"}, DeviceNameComparison::StartsWithIgnoreCase);
// Pafers Bike
RegisterNewDeviceTestData(DeviceIndex::PafersBike)
->expectDevice<pafersbike>()
->acceptDeviceName("PAFERS_", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith(QZSettings::pafers_treadmill,false);
// Pafers Treadmill
RegisterNewDeviceTestData(DeviceIndex::PafersTreadmill)
->expectDevice<paferstreadmill>()
->acceptDeviceName("PAFERS_", DeviceNameComparison::StartsWithIgnoreCase)
->configureSettingsWith( [](const DeviceDiscoveryInfo& info, bool enable, std::vector<DeviceDiscoveryInfo>& configurations)->void {
DeviceDiscoveryInfo config(info);
if (enable) {
for(int x = 1; x<=3; x++) {
config.setValue(QZSettings::pafers_treadmill, x & 1);
config.setValue(QZSettings::pafers_treadmill_bh_iboxster_plus, x & 2);
configurations.push_back(config);
}
} else {
config.setValue(QZSettings::pafers_treadmill, false);
config.setValue(QZSettings::pafers_treadmill_bh_iboxster_plus, false);
configurations.push_back(config);
}
});
// Pitpat Bike
RegisterNewDeviceTestData(DeviceIndex::PitpatBike)
->expectDevice<pitpatbike>()
->acceptDeviceName("PITPAT-S", DeviceNameComparison::StartsWithIgnoreCase);
// Proform Bike
RegisterNewDeviceTestData(DeviceIndex::ProformBike)
->expectDevice<proformbike>()
->acceptDeviceNames({"I_EB", "I_SB"}, DeviceNameComparison::StartsWith);
// Proform Elliptical
RegisterNewDeviceTestData(DeviceIndex::ProformElliptical)
->expectDevice<proformelliptical>()
->acceptDeviceName("I_FS", DeviceNameComparison::StartsWithIgnoreCase);
// Proform Elliptical Trainer
RegisterNewDeviceTestData(DeviceIndex::ProformEllipticalTrainer)
->expectDevice<proformellipticaltrainer>()
->acceptDeviceName("I_VE", DeviceNameComparison::StartsWithIgnoreCase);