incyclist-devices 2.0.38 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/adapters.d.ts +1 -1
- package/lib/antv2/adapter-factory.d.ts +4 -13
- package/lib/antv2/adapter.d.ts +16 -33
- package/lib/antv2/adapter.js +68 -112
- package/lib/antv2/ant-interface.d.ts +3 -11
- package/lib/antv2/ant-interface.js +1 -1
- package/lib/antv2/base/adapter.d.ts +62 -0
- package/lib/antv2/base/adapter.js +360 -0
- package/lib/antv2/base/ant-interface.d.ts +35 -0
- package/lib/antv2/base/ant-interface.js +285 -0
- package/lib/antv2/base/binding.d.ts +13 -0
- package/lib/antv2/base/binding.js +27 -0
- package/lib/antv2/cad/adapter.d.ts +10 -0
- package/lib/antv2/cad/adapter.js +25 -0
- package/lib/antv2/cad/index.d.ts +2 -0
- package/lib/antv2/cad/index.js +7 -0
- package/lib/antv2/consts.d.ts +2 -0
- package/lib/antv2/consts.js +5 -0
- package/lib/antv2/factories/adapter-factory.d.ts +14 -0
- package/lib/antv2/factories/adapter-factory.js +65 -0
- package/lib/antv2/factories/sensor-factory.d.ts +5 -0
- package/lib/antv2/factories/sensor-factory.js +22 -0
- package/lib/antv2/fe/adapter.d.ts +25 -26
- package/lib/antv2/fe/adapter.js +212 -218
- package/lib/antv2/hr/adapter.d.ts +6 -14
- package/lib/antv2/hr/adapter.js +7 -55
- package/lib/antv2/hr copy/adapter.d.ts +11 -0
- package/lib/antv2/hr copy/adapter.js +30 -0
- package/lib/antv2/hr copy/index.d.ts +2 -0
- package/lib/antv2/hr copy/index.js +7 -0
- package/lib/antv2/index.d.ts +5 -4
- package/lib/antv2/index.js +4 -2
- package/lib/antv2/pwr/adapter.d.ts +9 -29
- package/lib/antv2/pwr/adapter.js +20 -130
- package/lib/antv2/types.d.ts +23 -3
- package/lib/base/adpater.d.ts +42 -45
- package/lib/base/adpater.js +144 -110
- package/lib/base/consts.d.ts +4 -0
- package/lib/base/consts.js +9 -0
- package/lib/ble/adapter-factory.d.ts +4 -4
- package/lib/ble/base/adapter.d.ts +6 -24
- package/lib/ble/base/adapter.js +4 -94
- package/lib/ble/ble-interface.d.ts +2 -3
- package/lib/ble/cp/adapter.d.ts +6 -11
- package/lib/ble/cp/adapter.js +9 -12
- package/lib/ble/elite/adapter.d.ts +8 -8
- package/lib/ble/elite/adapter.js +6 -2
- package/lib/ble/fm/adapter.d.ts +11 -11
- package/lib/ble/fm/adapter.js +26 -20
- package/lib/ble/hr/adapter.d.ts +3 -4
- package/lib/ble/hr/adapter.js +2 -2
- package/lib/ble/tacx/adapter.d.ts +2 -3
- package/lib/ble/tacx/adapter.js +8 -8
- package/lib/ble/types.d.ts +1 -2
- package/lib/ble/wahoo/adapter.d.ts +2 -2
- package/lib/ble/wahoo/adapter.js +6 -6
- package/lib/ble/wahoo/comms.js +16 -16
- package/lib/factories/adapters.d.ts +7 -0
- package/lib/factories/adapters.js +49 -0
- package/lib/factories/index.d.ts +3 -0
- package/lib/factories/index.js +10 -0
- package/lib/factories/interfaces.d.ts +7 -0
- package/lib/factories/interfaces.js +27 -0
- package/lib/index.d.ts +8 -9
- package/lib/index.js +5 -8
- package/lib/interfaces.d.ts +1 -1
- package/lib/modes/ant-fe-adv-st-mode.d.ts +12 -0
- package/lib/modes/ant-fe-adv-st-mode.js +83 -0
- package/lib/modes/antble-erg.d.ts +31 -0
- package/lib/modes/antble-erg.js +28 -0
- package/lib/modes/antble-smarttrainer.d.ts +23 -0
- package/lib/modes/antble-smarttrainer.js +65 -0
- package/lib/modes/base.d.ts +29 -0
- package/lib/modes/{cycling-mode.js → base.js} +23 -26
- package/lib/modes/daum-classic-standard.d.ts +17 -0
- package/lib/modes/daum-classic-standard.js +54 -0
- package/lib/modes/daum-erg.d.ts +49 -0
- package/lib/{serial/daum/ERGCyclingMode.js → modes/daum-erg.js} +45 -73
- package/lib/modes/daum-power.d.ts +5 -0
- package/lib/{serial/daum/DaumPowerMeterCyclingMode.js → modes/daum-power.js} +1 -10
- package/lib/modes/daum-premium-standard.d.ts +24 -0
- package/lib/{serial/daum/premium/modes/daum-classic.js → modes/daum-premium-standard.js} +26 -38
- package/lib/modes/daum-smarttrainer.d.ts +83 -0
- package/lib/{serial/daum/SmartTrainerCyclingMode.js → modes/daum-smarttrainer.js} +23 -26
- package/lib/modes/kettler-erg.d.ts +44 -0
- package/lib/{serial/kettler/ergo-racer/modes/erg.js → modes/kettler-erg.js} +12 -23
- package/lib/modes/power-base.d.ts +28 -3
- package/lib/modes/power-base.js +184 -7
- package/lib/modes/power-meter.d.ts +11 -16
- package/lib/modes/power-meter.js +15 -54
- package/lib/modes/simulator.d.ts +38 -10
- package/lib/modes/simulator.js +14 -46
- package/lib/modes/{cycling-mode.d.ts → types.d.ts} +22 -30
- package/lib/modes/types.js +56 -0
- package/lib/serial/SinglePathScanner.d.ts +17 -0
- package/lib/serial/SinglePathScanner.js +87 -0
- package/lib/serial/adapter-factory.d.ts +8 -6
- package/lib/serial/adapter.d.ts +6 -11
- package/lib/serial/adapter.js +5 -2
- package/lib/serial/base/adapter.d.ts +17 -0
- package/lib/serial/base/adapter.js +67 -0
- package/lib/serial/base/comms.d.ts +62 -0
- package/lib/serial/base/comms.js +280 -0
- package/lib/serial/base/serial-interface.d.ts +36 -0
- package/lib/serial/base/serial-interface.js +288 -0
- package/lib/serial/base/serial-scanner.d.ts +16 -0
- package/lib/serial/base/serial-scanner.js +87 -0
- package/lib/serial/base/serialport.d.ts +17 -0
- package/lib/serial/base/serialport.js +87 -0
- package/lib/serial/comms.d.ts +2 -2
- package/lib/serial/daum/DaumAdapter.d.ts +26 -35
- package/lib/serial/daum/DaumAdapter.js +214 -161
- package/lib/serial/daum/classic/PROTOCOL_NAME.d.ts +2 -0
- package/lib/serial/daum/classic/PROTOCOL_NAME.js +5 -0
- package/lib/serial/daum/classic/adapter.d.ts +13 -26
- package/lib/serial/daum/classic/adapter.js +72 -176
- package/lib/serial/daum/classic/comms.d.ts +21 -17
- package/lib/serial/daum/classic/comms.js +41 -14
- package/lib/serial/daum/classic/consts.d.ts +2 -0
- package/lib/serial/daum/classic/consts.js +5 -0
- package/lib/serial/daum/classic/mock.d.ts +4 -0
- package/lib/serial/daum/classic/mock.js +18 -7
- package/lib/serial/daum/classic/types.d.ts +8 -10
- package/lib/serial/daum/classic/utils.d.ts +1 -2
- package/lib/serial/daum/consts.d.ts +0 -0
- package/lib/serial/daum/consts.js +0 -0
- package/lib/serial/daum/premium/adapter.d.ts +17 -15
- package/lib/serial/daum/premium/adapter.js +86 -109
- package/lib/serial/daum/premium/comms.d.ts +7 -7
- package/lib/serial/daum/premium/comms.js +25 -16
- package/lib/serial/daum/premium/mock.d.ts +5 -1
- package/lib/serial/daum/premium/mock.js +17 -7
- package/lib/serial/daum/premium/types.d.ts +32 -17
- package/lib/serial/daum/premium/types.js +8 -8
- package/lib/serial/daum/premium/utils.d.ts +2 -3
- package/lib/serial/daum/premium/utils.js +3 -3
- package/lib/serial/daum/types.d.ts +14 -0
- package/lib/serial/daum/types.js +13 -0
- package/lib/serial/factories/adapter-factory.d.ts +14 -0
- package/lib/serial/factories/adapter-factory.js +30 -0
- package/lib/serial/index.d.ts +8 -5
- package/lib/serial/index.js +15 -15
- package/lib/serial/kettler/comms.d.ts +1 -1
- package/lib/serial/kettler/ergo-racer/adapter.d.ts +11 -16
- package/lib/serial/kettler/ergo-racer/adapter.js +10 -12
- package/lib/serial/kettler/types.d.ts +8 -0
- package/lib/serial/kettler/types.js +2 -0
- package/lib/serial/serial-interface.d.ts +2 -32
- package/lib/serial/serial-interface.js +4 -78
- package/lib/serial/serial-scanner.d.ts +16 -0
- package/lib/serial/serial-scanner.js +87 -0
- package/lib/serial/serialport.d.ts +1 -13
- package/lib/serial/types.d.ts +45 -0
- package/lib/serial/types.js +9 -0
- package/lib/simulator/Simulator.d.ts +13 -19
- package/lib/simulator/Simulator.js +10 -51
- package/lib/types/Command.d.ts +8 -0
- package/lib/types/Command.js +2 -0
- package/lib/types/adapter.d.ts +34 -24
- package/lib/types/command.d.ts +0 -8
- package/lib/types/command.js +0 -2
- package/lib/types/data.d.ts +12 -1
- package/lib/types/device.d.ts +8 -23
- package/lib/types/device.js +9 -8
- package/lib/types/index.d.ts +6 -0
- package/lib/types/index.js +22 -0
- package/lib/types/route.d.ts +0 -19
- package/lib/types/route.js +0 -2
- package/lib/types/types.d.ts +8 -0
- package/lib/types/types.js +2 -0
- package/lib/utils/utils.d.ts +2 -1
- package/lib/utils/utils.js +22 -4
- package/package.json +3 -3
- package/lib/antv2/modes/ant-fe-adv-st-mode.d.ts +0 -9
- package/lib/antv2/modes/ant-fe-adv-st-mode.js +0 -51
- package/lib/antv2/modes/ant-fe-erg-mode.d.ts +0 -6
- package/lib/antv2/modes/ant-fe-erg-mode.js +0 -14
- package/lib/antv2/modes/ant-fe-st-mode.d.ts +0 -5
- package/lib/antv2/modes/ant-fe-st-mode.js +0 -13
- package/lib/modes/ble-erg-mode.d.ts +0 -18
- package/lib/modes/ble-erg-mode.js +0 -148
- package/lib/modes/ble-st-mode.d.ts +0 -15
- package/lib/modes/ble-st-mode.js +0 -96
- package/lib/serial/daum/DaumPowerMeterCyclingMode.d.ts +0 -8
- package/lib/serial/daum/ERGCyclingMode.d.ts +0 -26
- package/lib/serial/daum/SmartTrainerCyclingMode.d.ts +0 -42
- package/lib/serial/daum/classic/modes/daum-classic.d.ts +0 -13
- package/lib/serial/daum/classic/modes/daum-classic.js +0 -97
- package/lib/serial/daum/constants.d.ts +0 -19
- package/lib/serial/daum/constants.js +0 -22
- package/lib/serial/daum/premium/modes/daum-classic.d.ts +0 -14
- package/lib/serial/kettler/ergo-racer/modes/erg.d.ts +0 -25
|
@@ -15,249 +15,132 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
const gd_eventlog_1 = require("gd-eventlog");
|
|
16
16
|
const utils_1 = require("../../../utils/utils");
|
|
17
17
|
const DaumAdapter_1 = __importDefault(require("../DaumAdapter"));
|
|
18
|
-
const
|
|
18
|
+
const daum_classic_standard_1 = __importDefault(require("../../../modes/daum-classic-standard"));
|
|
19
19
|
const comms_1 = __importDefault(require("./comms"));
|
|
20
|
-
const serial_interface_1 = __importDefault(require("../../serial-interface"));
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
let serial;
|
|
26
|
-
if (ifaceName && typeof ifaceName === 'string') {
|
|
27
|
-
serial = serial_interface_1.default.getInstance({ ifaceName });
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
serial = props.interface;
|
|
31
|
-
}
|
|
32
|
-
if (!serial || !serial.binding)
|
|
33
|
-
throw new Error(`unknonwn interface: ${ifaceName}`);
|
|
34
|
-
const path = `${port}`;
|
|
35
|
-
return { serial, path };
|
|
36
|
-
};
|
|
20
|
+
const serial_interface_1 = __importDefault(require("../../base/serial-interface"));
|
|
21
|
+
const daum_erg_1 = __importDefault(require("../../../modes/daum-erg"));
|
|
22
|
+
const daum_smarttrainer_1 = __importDefault(require("../../../modes/daum-smarttrainer"));
|
|
23
|
+
const daum_power_1 = __importDefault(require("../../../modes/daum-power"));
|
|
24
|
+
const consts_1 = require("./consts");
|
|
37
25
|
class DaumClassicAdapter extends DaumAdapter_1.default {
|
|
38
26
|
constructor(settings, props) {
|
|
39
27
|
super(settings, props);
|
|
40
28
|
const logger = new gd_eventlog_1.EventLogger('DaumClassic');
|
|
41
|
-
const commProps = Object.assign(Object.assign({}, getBikeProps(settings)), { logger });
|
|
42
|
-
this.
|
|
29
|
+
const commProps = Object.assign(Object.assign({}, this.getBikeProps(settings)), { logger });
|
|
30
|
+
this.comms = new comms_1.default(commProps);
|
|
43
31
|
this.logger = logger;
|
|
44
|
-
this.name = PROTOCOL_NAME;
|
|
45
|
-
this.ignoreHrm = false;
|
|
46
|
-
this.ignorePower = false;
|
|
47
|
-
this.ignoreBike = false;
|
|
48
|
-
this.stopped = false;
|
|
49
|
-
this.started = false;
|
|
50
|
-
this.paused = undefined;
|
|
51
|
-
this.iv = undefined;
|
|
52
|
-
this.distanceInternal = undefined;
|
|
53
|
-
this.startPromise = undefined;
|
|
54
|
-
this.checkPromise = undefined;
|
|
32
|
+
this.name = consts_1.PROTOCOL_NAME;
|
|
55
33
|
this.initData();
|
|
56
34
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
35
|
+
getBikeProps(props) {
|
|
36
|
+
const { port, interface: ifaceName } = props;
|
|
37
|
+
let serial;
|
|
38
|
+
if (ifaceName && typeof ifaceName === 'string') {
|
|
39
|
+
serial = serial_interface_1.default.getInstance({ ifaceName });
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
serial = props.interface;
|
|
43
|
+
}
|
|
44
|
+
if (!serial || !serial.binding)
|
|
45
|
+
throw new Error(`unknonwn interface: ${ifaceName}`);
|
|
46
|
+
const path = `${port}`;
|
|
47
|
+
return { serial, path };
|
|
62
48
|
}
|
|
63
49
|
getName() {
|
|
64
50
|
return this.name;
|
|
65
51
|
}
|
|
66
52
|
setName(name) {
|
|
67
|
-
this.name = name
|
|
68
|
-
}
|
|
69
|
-
getPort() {
|
|
70
|
-
return this.bike.getPort();
|
|
53
|
+
this.name = name;
|
|
71
54
|
}
|
|
72
55
|
getProtocolName() {
|
|
73
|
-
return PROTOCOL_NAME;
|
|
74
|
-
}
|
|
75
|
-
getSupportedCyclingModes() {
|
|
76
|
-
const supported = super.getSupportedCyclingModes();
|
|
77
|
-
supported.push(daum_classic_1.default);
|
|
78
|
-
return supported;
|
|
79
|
-
}
|
|
80
|
-
getDefaultCyclingMode() {
|
|
81
|
-
return new daum_classic_1.default(this);
|
|
82
|
-
}
|
|
83
|
-
getSerialInterface() {
|
|
84
|
-
var _a;
|
|
85
|
-
return (_a = this.bike) === null || _a === void 0 ? void 0 : _a.serial;
|
|
86
|
-
}
|
|
87
|
-
check() {
|
|
88
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
-
if (this.isStopped())
|
|
90
|
-
return false;
|
|
91
|
-
if (this.checkPromise) {
|
|
92
|
-
this.logEvent({ message: "waiting for previous check device", port: this.getPort() });
|
|
93
|
-
try {
|
|
94
|
-
yield this.checkPromise;
|
|
95
|
-
}
|
|
96
|
-
catch (_a) { }
|
|
97
|
-
this.logEvent({ message: "previous check device completed", port: this.getPort() });
|
|
98
|
-
this.checkPromise = undefined;
|
|
99
|
-
}
|
|
100
|
-
this.checkPromise = this.performCheck();
|
|
101
|
-
try {
|
|
102
|
-
const res = yield this.checkPromise;
|
|
103
|
-
this.checkPromise = undefined;
|
|
104
|
-
return res;
|
|
105
|
-
}
|
|
106
|
-
catch (err) {
|
|
107
|
-
this.checkPromise = undefined;
|
|
108
|
-
throw err;
|
|
109
|
-
}
|
|
110
|
-
});
|
|
56
|
+
return consts_1.PROTOCOL_NAME;
|
|
111
57
|
}
|
|
112
58
|
performCheck() {
|
|
113
59
|
return __awaiter(this, void 0, void 0, function* () {
|
|
114
60
|
var info = {};
|
|
115
|
-
|
|
61
|
+
const check = new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
116
62
|
this.logEvent({ message: "checking device", port: this.getPort() });
|
|
117
|
-
const iv = setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
118
|
-
this.logEvent({ message: "checking device failed", port: this.getPort(), reason: 'timeout' });
|
|
119
|
-
resolve(false);
|
|
120
|
-
}), 5000);
|
|
121
63
|
try {
|
|
122
|
-
|
|
64
|
+
yield this.stop();
|
|
65
|
+
const connected = yield (0, utils_1.waitWithTimeout)(this.connect(), 5000, () => {
|
|
66
|
+
this.logEvent({ message: "checking device failed", port: this.getPort(), reason: 'timeout' });
|
|
67
|
+
});
|
|
123
68
|
if (!connected) {
|
|
124
|
-
clearTimeout(iv);
|
|
125
69
|
resolve(false);
|
|
126
70
|
return;
|
|
127
71
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
info.
|
|
72
|
+
this.stopped = false;
|
|
73
|
+
const address = yield this.getComms().getAddress();
|
|
74
|
+
info.bikeNo = address === null || address === void 0 ? void 0 : address.bike;
|
|
75
|
+
const version = yield this.getComms().getVersion();
|
|
76
|
+
info.serialNo = version === null || version === void 0 ? void 0 : version.serialNo;
|
|
77
|
+
info.cockpit = version === null || version === void 0 ? void 0 : version.cockpit;
|
|
133
78
|
this.setName('Daum ' + info.cockpit);
|
|
134
|
-
this.
|
|
135
|
-
|
|
79
|
+
this.pause();
|
|
80
|
+
this.started = false;
|
|
136
81
|
this.logEvent({ message: "checking device success", port: this.getPort(), info });
|
|
137
82
|
resolve(true);
|
|
138
83
|
}
|
|
139
84
|
catch (err) {
|
|
140
|
-
|
|
141
|
-
this.logEvent({ message: "checking device failed", port: this.getPort(), reason: err.message || err });
|
|
85
|
+
this.logEvent({ message: "checking device failed", port: this.getPort(), reason: err.message });
|
|
142
86
|
resolve(false);
|
|
143
87
|
}
|
|
144
88
|
}));
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
this.logEvent({ message: 'relaunch of device' });
|
|
150
|
-
try {
|
|
151
|
-
yield this.launch(props, true);
|
|
152
|
-
return true;
|
|
153
|
-
}
|
|
154
|
-
catch (err) {
|
|
155
|
-
this.logEvent({ message: 'start result: error', error: err.message });
|
|
156
|
-
throw err;
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
start(props = {}) {
|
|
161
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
-
const isRelaunch = this.started;
|
|
163
|
-
const message = isRelaunch ? 'relaunch of device' : 'initial start of device';
|
|
164
|
-
this.logEvent({ message });
|
|
165
|
-
try {
|
|
166
|
-
yield this.launch(props, isRelaunch);
|
|
167
|
-
return true;
|
|
168
|
-
}
|
|
169
|
-
catch (err) {
|
|
170
|
-
this.logEvent({ message: 'start result: error', error: err.message });
|
|
171
|
-
throw err;
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
launch(props, isRelaunch = false) {
|
|
176
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
177
|
-
try {
|
|
178
|
-
if (!this.startPromise) {
|
|
179
|
-
if (isRelaunch) {
|
|
180
|
-
yield this.stop();
|
|
181
|
-
this.bike.resumeLogging();
|
|
182
|
-
}
|
|
183
|
-
this.startPromise = this.performStart(props, isRelaunch);
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
this.logEvent({ message: 'start already ongoing' });
|
|
187
|
-
}
|
|
188
|
-
yield this.startPromise;
|
|
189
|
-
this.startPromise = undefined;
|
|
190
|
-
if (!isRelaunch) {
|
|
191
|
-
try {
|
|
192
|
-
const version = yield this.bike.getVersion();
|
|
193
|
-
const { serialNo, cockpit } = version || {};
|
|
194
|
-
this.logEvent({ message: 'device info', deviceInfo: { serialNo, cockpit } });
|
|
195
|
-
}
|
|
196
|
-
catch (_a) { }
|
|
197
|
-
}
|
|
198
|
-
this.logEvent({ message: 'start result: success' });
|
|
199
|
-
this.started = true;
|
|
200
|
-
return true;
|
|
201
|
-
}
|
|
202
|
-
catch (err) {
|
|
203
|
-
this.logEvent({ message: 'start result: error', error: err.message });
|
|
204
|
-
this.startPromise = undefined;
|
|
205
|
-
this.started = false;
|
|
206
|
-
throw new Error(`could not start device, reason:${err.message}`);
|
|
207
|
-
}
|
|
89
|
+
return yield (0, utils_1.waitWithTimeout)(check, 5000, () => {
|
|
90
|
+
this.logEvent({ message: "checking device failed", port: this.getPort(), reason: 'Timeout' });
|
|
91
|
+
return false;
|
|
92
|
+
});
|
|
208
93
|
});
|
|
209
94
|
}
|
|
210
95
|
performStart(props = {}, isRelaunch = false) {
|
|
211
96
|
this.stopUpdatePull();
|
|
212
97
|
this.setBikeProps(props);
|
|
213
|
-
const user = this.
|
|
214
|
-
const { gear = DEFAULT_GEAR } = props;
|
|
98
|
+
const user = this.getUser();
|
|
99
|
+
const { gear = consts_1.DEFAULT_GEAR } = props;
|
|
215
100
|
this.initData();
|
|
216
101
|
let startState = {};
|
|
217
102
|
return (0, utils_1.runWithRetries)(() => __awaiter(this, void 0, void 0, function* () {
|
|
218
103
|
try {
|
|
219
|
-
this.logEvent({ message: 'start attempt', isRelaunch, isConnected: this.
|
|
220
|
-
if (!isRelaunch && !this.
|
|
221
|
-
|
|
222
|
-
if (!connected)
|
|
223
|
-
throw new Error('Could not connect');
|
|
104
|
+
this.logEvent({ message: 'start attempt', isRelaunch, isConnected: this.getComms().isConnected() });
|
|
105
|
+
if (!isRelaunch && !this.getComms().isConnected()) {
|
|
106
|
+
yield this.verifyConnection();
|
|
224
107
|
}
|
|
225
|
-
yield this.
|
|
108
|
+
yield this.getComms().resetDevice();
|
|
226
109
|
if (!startState.setProg) {
|
|
227
|
-
yield this.
|
|
110
|
+
yield this.getComms().setProg(0);
|
|
228
111
|
startState.setProg = true;
|
|
229
112
|
}
|
|
230
113
|
if (!startState.setPerson) {
|
|
231
|
-
yield this.
|
|
114
|
+
yield this.getComms().setPerson(user);
|
|
232
115
|
startState.setPerson = true;
|
|
233
116
|
}
|
|
234
117
|
if (!startState.setBikeType) {
|
|
235
118
|
const bikeType = this.getCyclingMode().getSetting('bikeType') || 'race';
|
|
236
|
-
yield this.
|
|
119
|
+
yield this.getComms().setBikeType(bikeType.toLowerCase());
|
|
237
120
|
startState.setBikeType = true;
|
|
238
121
|
}
|
|
239
122
|
if (!startState.startProg) {
|
|
240
|
-
yield this.
|
|
123
|
+
yield this.getComms().startProg();
|
|
241
124
|
startState.startProg = true;
|
|
242
125
|
}
|
|
243
126
|
if (!startState.setGear) {
|
|
244
|
-
yield this.
|
|
127
|
+
yield this.getComms().setGear(this.deviceData.gear || gear);
|
|
245
128
|
startState.setGear = true;
|
|
246
129
|
}
|
|
247
130
|
const startRequest = this.getCyclingMode().getBikeInitRequest();
|
|
248
131
|
yield this.sendRequest(startRequest);
|
|
249
132
|
startState.checkRunData = true;
|
|
250
|
-
const data = yield this.
|
|
133
|
+
const data = yield this.getComms().runData();
|
|
251
134
|
if (startRequest.targetPower && startRequest.targetPower !== 25 && data.power === 25) {
|
|
252
135
|
throw new Error('invalid device response: runData');
|
|
253
136
|
}
|
|
254
|
-
this.
|
|
255
|
-
this.paused = false;
|
|
137
|
+
this.started = true;
|
|
256
138
|
this.startUpdatePull();
|
|
257
|
-
return
|
|
139
|
+
return true;
|
|
258
140
|
}
|
|
259
141
|
catch (err) {
|
|
260
142
|
this.logEvent({ message: 'start attempt failed', error: err.message });
|
|
143
|
+
this.started = false;
|
|
261
144
|
if (startState.checkRunData) {
|
|
262
145
|
startState = {};
|
|
263
146
|
}
|
|
@@ -269,9 +152,22 @@ class DaumClassicAdapter extends DaumAdapter_1.default {
|
|
|
269
152
|
return __awaiter(this, void 0, void 0, function* () {
|
|
270
153
|
if (this.stopped)
|
|
271
154
|
return;
|
|
272
|
-
|
|
155
|
+
yield this.verifyConnection();
|
|
156
|
+
return this.getComms().runData();
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
getDeviceInfo() {
|
|
160
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
161
|
+
if (this.stopped)
|
|
162
|
+
return;
|
|
163
|
+
const version = yield this.getComms().getVersion();
|
|
164
|
+
return version || {};
|
|
273
165
|
});
|
|
274
166
|
}
|
|
275
167
|
}
|
|
276
|
-
DaumClassicAdapter.NAME = PROTOCOL_NAME;
|
|
168
|
+
DaumClassicAdapter.NAME = consts_1.PROTOCOL_NAME;
|
|
169
|
+
DaumClassicAdapter.controllers = {
|
|
170
|
+
modes: [daum_erg_1.default, daum_smarttrainer_1.default, daum_power_1.default, daum_classic_standard_1.default],
|
|
171
|
+
default: daum_classic_standard_1.default
|
|
172
|
+
};
|
|
277
173
|
exports.default = DaumClassicAdapter;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { User } from '../../../types/user';
|
|
2
1
|
import { ClassicBikeResponse, DaumClassicCommsState, DaumClassicRequest, DaumClassicResponse, GetVersionReponse, ProgResponse, SetGearRepsonse, SetPowerRepsonse, SetProgResponse, SetSlopeRepsonse, checkCockpitReponse } from './types';
|
|
3
|
-
import SerialPortComms from '../../comms';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
2
|
+
import SerialPortComms from '../../base/comms';
|
|
3
|
+
import { DaumSerialComms } from '../types';
|
|
4
|
+
import { SerialCommProps } from '../../types';
|
|
5
|
+
import { DeviceType, IncyclistBikeData, User } from '../../../types';
|
|
6
|
+
export default class Daum8008 extends SerialPortComms<DaumClassicCommsState, DaumClassicRequest, DaumClassicResponse> implements DaumSerialComms {
|
|
7
|
+
protected bikeNo: number;
|
|
8
|
+
constructor(props: SerialCommProps);
|
|
7
9
|
validatePath(path: string): string;
|
|
8
10
|
getDefaultLoggerName(): string;
|
|
9
11
|
onConnected(): void;
|
|
@@ -13,23 +15,25 @@ export default class Daum8008 extends SerialPortComms<DaumClassicCommsState, Dau
|
|
|
13
15
|
doSend(expected: number, payload: Uint8Array): Promise<DaumClassicResponse>;
|
|
14
16
|
send(request: DaumClassicRequest): Promise<DaumClassicResponse>;
|
|
15
17
|
sendCommand(logString: string, command: number[], expected: any): Promise<Uint8Array>;
|
|
16
|
-
checkCockpit(
|
|
18
|
+
checkCockpit(bike?: number): Promise<checkCockpitReponse>;
|
|
17
19
|
getAddress(): Promise<ClassicBikeResponse>;
|
|
18
|
-
getVersion(
|
|
19
|
-
resetDevice(
|
|
20
|
-
startProg(
|
|
21
|
-
stopProg(
|
|
22
|
-
setProg(progNo?: number,
|
|
23
|
-
setBikeType(bikeType: DeviceType,
|
|
24
|
-
setPerson(user?: User,
|
|
20
|
+
getVersion(bike?: number): Promise<GetVersionReponse>;
|
|
21
|
+
resetDevice(bike?: number): Promise<ClassicBikeResponse>;
|
|
22
|
+
startProg(bike?: number): Promise<ProgResponse>;
|
|
23
|
+
stopProg(bike?: number): Promise<ProgResponse>;
|
|
24
|
+
setProg(progNo?: number, bike?: number): Promise<SetProgResponse>;
|
|
25
|
+
setBikeType(bikeType: DeviceType, bike?: number): Promise<ClassicBikeResponse>;
|
|
26
|
+
setPerson(user?: User, bike?: number): Promise<{
|
|
25
27
|
bike: number;
|
|
26
28
|
age: number;
|
|
27
29
|
gender: number;
|
|
28
30
|
length: number;
|
|
29
31
|
weight: number;
|
|
30
32
|
}>;
|
|
31
|
-
runData(
|
|
32
|
-
setGear(gear: number,
|
|
33
|
-
setPower(power: number,
|
|
34
|
-
setSlope(slope: number,
|
|
33
|
+
runData(bike?: number): Promise<IncyclistBikeData>;
|
|
34
|
+
setGear(gear: number, bike?: number): Promise<SetGearRepsonse>;
|
|
35
|
+
setPower(power: number, bike?: number): Promise<SetPowerRepsonse>;
|
|
36
|
+
setSlope(slope: number, bike?: number): Promise<SetSlopeRepsonse>;
|
|
37
|
+
setTargetSlope(slope: number): Promise<void>;
|
|
38
|
+
setTargetPower(power: number): Promise<void>;
|
|
35
39
|
}
|
|
@@ -13,12 +13,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const utils_1 = require("../../../utils/utils");
|
|
16
|
-
const comms_1 = __importDefault(require("../../comms"));
|
|
17
|
-
const types_1 = require("../premium/types");
|
|
16
|
+
const comms_1 = __importDefault(require("../../base/comms"));
|
|
18
17
|
const utils_2 = require("./utils");
|
|
18
|
+
const types_1 = require("../types");
|
|
19
19
|
const ByteLength = require('@serialport/parser-byte-length');
|
|
20
20
|
const TIMEOUT_SEND = 2000;
|
|
21
21
|
class Daum8008 extends comms_1.default {
|
|
22
|
+
constructor(props) {
|
|
23
|
+
super(props);
|
|
24
|
+
this.bikeNo = 0;
|
|
25
|
+
}
|
|
22
26
|
validatePath(path) {
|
|
23
27
|
return path;
|
|
24
28
|
}
|
|
@@ -104,8 +108,9 @@ class Daum8008 extends comms_1.default {
|
|
|
104
108
|
return response.data;
|
|
105
109
|
});
|
|
106
110
|
}
|
|
107
|
-
checkCockpit(
|
|
111
|
+
checkCockpit(bike) {
|
|
108
112
|
return __awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
const bikeNo = bike === undefined ? this.bikeNo : bike;
|
|
109
114
|
try {
|
|
110
115
|
const data = yield this.sendCommand(`checkCockpit(${bikeNo})`, [0x10, bikeNo], 3);
|
|
111
116
|
return { bike: data[1], version: data[2] };
|
|
@@ -120,48 +125,56 @@ class Daum8008 extends comms_1.default {
|
|
|
120
125
|
getAddress() {
|
|
121
126
|
return __awaiter(this, void 0, void 0, function* () {
|
|
122
127
|
const data = yield this.sendCommand(`getAddress()`, [0x11], 2);
|
|
128
|
+
this.bikeNo = data[1];
|
|
123
129
|
return { bike: data[1] };
|
|
124
130
|
});
|
|
125
131
|
}
|
|
126
|
-
getVersion(
|
|
132
|
+
getVersion(bike) {
|
|
127
133
|
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
const bikeNo = bike === undefined ? this.bikeNo : bike;
|
|
128
135
|
const data = yield this.sendCommand(`getVersion(${bikeNo})`, [0x73, bikeNo], 11);
|
|
129
136
|
return { bike: data[1], serialNo: (0, utils_2.getSerialNo)(data, 2, 8), cockpit: (0, utils_2.getCockpit)(data[10]) };
|
|
130
137
|
});
|
|
131
138
|
}
|
|
132
|
-
resetDevice(
|
|
139
|
+
resetDevice(bike) {
|
|
133
140
|
return __awaiter(this, void 0, void 0, function* () {
|
|
141
|
+
const bikeNo = bike === undefined ? this.bikeNo : bike;
|
|
134
142
|
const data = yield this.sendCommand(`resetDevice(${bikeNo})`, [0x12, bikeNo], 2);
|
|
135
143
|
return { bike: data[1] };
|
|
136
144
|
});
|
|
137
145
|
}
|
|
138
|
-
startProg(
|
|
146
|
+
startProg(bike) {
|
|
139
147
|
return __awaiter(this, void 0, void 0, function* () {
|
|
148
|
+
const bikeNo = bike === undefined ? this.bikeNo : bike;
|
|
140
149
|
const data = yield this.sendCommand(`startProg(${bikeNo})`, [0x21, bikeNo], 3);
|
|
141
150
|
return { bike: data[1], pedalling: data[2] > 0 };
|
|
142
151
|
});
|
|
143
152
|
}
|
|
144
|
-
stopProg(
|
|
153
|
+
stopProg(bike) {
|
|
145
154
|
return __awaiter(this, void 0, void 0, function* () {
|
|
155
|
+
const bikeNo = bike === undefined ? this.bikeNo : bike;
|
|
146
156
|
const data = yield this.sendCommand(`stopProg(${bikeNo})`, [0x22, bikeNo], 3);
|
|
147
157
|
return { bike: data[1], pedalling: data[2] > 0 };
|
|
148
158
|
});
|
|
149
159
|
}
|
|
150
|
-
setProg(progNo = 0,
|
|
160
|
+
setProg(progNo = 0, bike) {
|
|
151
161
|
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
+
const bikeNo = bike === undefined ? this.bikeNo : bike;
|
|
152
163
|
const data = yield this.sendCommand(`setProg(${bikeNo},${progNo})`, [0x23, bikeNo, progNo], 4);
|
|
153
164
|
return { bike: data[1], progNo: data[2], pedalling: data[3] !== 0 };
|
|
154
165
|
});
|
|
155
166
|
}
|
|
156
|
-
setBikeType(bikeType,
|
|
167
|
+
setBikeType(bikeType, bike) {
|
|
157
168
|
return __awaiter(this, void 0, void 0, function* () {
|
|
169
|
+
const bikeNo = bike === undefined ? this.bikeNo : bike;
|
|
158
170
|
const bikeVal = (0, utils_2.getBikeType)(bikeType);
|
|
159
171
|
const data = yield this.sendCommand(`setBikeType(${bikeNo},${bikeType})`, [0x69, bikeNo, 0, 0, bikeVal], 3);
|
|
160
172
|
return { bike: data[1] };
|
|
161
173
|
});
|
|
162
174
|
}
|
|
163
|
-
setPerson(user = {},
|
|
175
|
+
setPerson(user = {}, bike) {
|
|
164
176
|
return __awaiter(this, void 0, void 0, function* () {
|
|
177
|
+
const bikeNo = bike === undefined ? this.bikeNo : bike;
|
|
165
178
|
const age = user.age !== undefined ? user.age : utils_2.DEFAULT_AGE;
|
|
166
179
|
const gender = (0, utils_2.getGender)(user.sex);
|
|
167
180
|
const length = (0, utils_2.getLength)(user.length);
|
|
@@ -194,32 +207,46 @@ class Daum8008 extends comms_1.default {
|
|
|
194
207
|
return ({ bike: data[1], age, gender, length, weight });
|
|
195
208
|
});
|
|
196
209
|
}
|
|
197
|
-
runData(
|
|
210
|
+
runData(bike) {
|
|
198
211
|
return __awaiter(this, void 0, void 0, function* () {
|
|
212
|
+
const bikeNo = bike === undefined ? this.bikeNo : bike;
|
|
199
213
|
const data = yield this.sendCommand(`runData(${bikeNo})`, [0x40, bikeNo], 19);
|
|
200
214
|
return (0, utils_2.parseRunData)(data);
|
|
201
215
|
});
|
|
202
216
|
}
|
|
203
|
-
setGear(gear,
|
|
217
|
+
setGear(gear, bike) {
|
|
204
218
|
return __awaiter(this, void 0, void 0, function* () {
|
|
219
|
+
const bikeNo = bike === undefined ? this.bikeNo : bike;
|
|
205
220
|
const gearVal = (0, utils_2.between)(gear, 1, 28);
|
|
206
221
|
const data = yield this.sendCommand(`setGear(${bikeNo},${gearVal})`, [0x53, bikeNo, gearVal], 3);
|
|
207
222
|
return ({ bike: data[1], gear: data[2] });
|
|
208
223
|
});
|
|
209
224
|
}
|
|
210
|
-
setPower(power,
|
|
225
|
+
setPower(power, bike) {
|
|
211
226
|
return __awaiter(this, void 0, void 0, function* () {
|
|
227
|
+
const bikeNo = bike === undefined ? this.bikeNo : bike;
|
|
212
228
|
const powerVal = Math.round((0, utils_2.between)(power, 25, 800) / 5);
|
|
213
229
|
const data = yield this.sendCommand(`setPower(${bikeNo},${power})`, [0x51, bikeNo, powerVal], 3);
|
|
214
230
|
return ({ bike: data[1], power: data[2] * 5 });
|
|
215
231
|
});
|
|
216
232
|
}
|
|
217
|
-
setSlope(slope,
|
|
233
|
+
setSlope(slope, bike) {
|
|
218
234
|
return __awaiter(this, void 0, void 0, function* () {
|
|
235
|
+
const bikeNo = bike === undefined ? this.bikeNo : bike;
|
|
219
236
|
const cmd = (0, utils_2.buildSetSlopeCommand)(bikeNo, slope);
|
|
220
237
|
const data = yield this.sendCommand(`setSlope(${bikeNo},${slope})`, cmd, 6);
|
|
221
238
|
return ({ bike: data[1], slope });
|
|
222
239
|
});
|
|
223
240
|
}
|
|
241
|
+
setTargetSlope(slope) {
|
|
242
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
243
|
+
yield this.setSlope(slope);
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
setTargetPower(power) {
|
|
247
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
248
|
+
yield this.setPower(power);
|
|
249
|
+
});
|
|
250
|
+
}
|
|
224
251
|
}
|
|
225
252
|
exports.default = Daum8008;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
2
3
|
import { MockBindingInterface, MockPortBinding, CreatePortOptions } from '@serialport/binding-mock';
|
|
3
4
|
import { BindingInterface } from '@serialport/bindings-interface';
|
|
4
5
|
export type MockProps = {
|
|
@@ -65,11 +66,14 @@ export declare class DaumClassicSimulator {
|
|
|
65
66
|
_timeoutResponse: number;
|
|
66
67
|
_simulateNoReponseCnt: number;
|
|
67
68
|
_simulateIllegalResponseCnt: number;
|
|
69
|
+
openHandles: Array<NodeJS.Timeout>;
|
|
68
70
|
constructor();
|
|
69
71
|
reset(): void;
|
|
70
72
|
simulateTimeout(ms: number): void;
|
|
71
73
|
simulateNoResponse(cnt?: number): void;
|
|
72
74
|
simulateIllegalResponse(cnt?: number): void;
|
|
75
|
+
addHandle(handle: NodeJS.Timeout): void;
|
|
76
|
+
cleanup(): void;
|
|
73
77
|
isPedalling(): 0 | 1;
|
|
74
78
|
}
|
|
75
79
|
export declare class DaumClassicMockBinding extends MockPortBinding {
|
|
@@ -14,9 +14,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.DaumClassicMockBinding = exports.DaumClassicSimulator = exports.DaumClassicMockImpl = exports.DaumClassicMock = void 0;
|
|
16
16
|
const binding_mock_1 = require("@serialport/binding-mock");
|
|
17
|
-
const __1 = require("../../");
|
|
18
17
|
const utils_1 = require("../../../utils/utils");
|
|
19
18
|
const calculations_1 = __importDefault(require("../../../utils/calculations"));
|
|
19
|
+
const serialport_1 = __importDefault(require("../../base/serialport"));
|
|
20
|
+
const serial_interface_1 = __importDefault(require("../../base/serial-interface"));
|
|
20
21
|
exports.DaumClassicMock = {
|
|
21
22
|
reset() {
|
|
22
23
|
DaumClassicMockImpl.getInstance().reset();
|
|
@@ -43,8 +44,8 @@ class DaumClassicMockImpl {
|
|
|
43
44
|
}
|
|
44
45
|
static reset() {
|
|
45
46
|
DaumClassicMockImpl._instance = undefined;
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
serialport_1.default._instance = undefined;
|
|
48
|
+
serial_interface_1.default._instances = [];
|
|
48
49
|
}
|
|
49
50
|
constructor() {
|
|
50
51
|
this.simulators = new Map();
|
|
@@ -90,6 +91,7 @@ class DaumClassicSimulator {
|
|
|
90
91
|
this._timeoutResponse = 0;
|
|
91
92
|
this._simulateNoReponseCnt = 0;
|
|
92
93
|
this._simulateIllegalResponseCnt = 0;
|
|
94
|
+
this.openHandles = [];
|
|
93
95
|
for (let i = 0; i < 10; i++)
|
|
94
96
|
this.bikes.push(Object.assign({}, DEFAULT_BIKE_DATA));
|
|
95
97
|
this.reset();
|
|
@@ -117,6 +119,12 @@ class DaumClassicSimulator {
|
|
|
117
119
|
simulateIllegalResponse(cnt = 1) {
|
|
118
120
|
this._simulateIllegalResponseCnt += cnt;
|
|
119
121
|
}
|
|
122
|
+
addHandle(handle) {
|
|
123
|
+
this.openHandles.push(handle);
|
|
124
|
+
}
|
|
125
|
+
cleanup() {
|
|
126
|
+
this.openHandles.forEach(to => { clearTimeout(to); });
|
|
127
|
+
}
|
|
120
128
|
isPedalling() {
|
|
121
129
|
if (this.cadence && this.cadence > 0)
|
|
122
130
|
return 1;
|
|
@@ -180,9 +188,11 @@ class DaumClassicMockBinding extends binding_mock_1.MockPortBinding {
|
|
|
180
188
|
this.simulator._simulateNoReponseCnt--;
|
|
181
189
|
return;
|
|
182
190
|
}
|
|
183
|
-
const
|
|
184
|
-
if (handler)
|
|
185
|
-
setTimeout(() => { handler(payload); },
|
|
191
|
+
const toVal = this.simulator._timeoutResponse || 5;
|
|
192
|
+
if (handler) {
|
|
193
|
+
const to = setTimeout(() => { handler(payload); }, toVal);
|
|
194
|
+
this.simulator.addHandle(to);
|
|
195
|
+
}
|
|
186
196
|
}
|
|
187
197
|
catch (err) {
|
|
188
198
|
}
|
|
@@ -346,7 +356,8 @@ class DaumClassicMockBinding extends binding_mock_1.MockPortBinding {
|
|
|
346
356
|
if (bikeNo >= 0 && bikeNo < 10) {
|
|
347
357
|
this.simulator.targetPower = power;
|
|
348
358
|
this.simulator.isPowerMode = true;
|
|
349
|
-
setTimeout(() => { this.simulator.currentPower = power; }, 1000);
|
|
359
|
+
const to = setTimeout(() => { this.simulator.currentPower = power; }, 1000);
|
|
360
|
+
this.simulator.addHandle(to);
|
|
350
361
|
const response = Buffer.from([0x51, bikeNo, power]);
|
|
351
362
|
this.emitData(response);
|
|
352
363
|
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { IncyclistBikeData } from "
|
|
2
|
-
import { DaumBikeData, DeviceProperties } from "../../../types/device";
|
|
1
|
+
import { DeviceProperties, IncyclistBikeData } from "../../../types";
|
|
3
2
|
import { Queue } from "../../../utils/utils";
|
|
4
|
-
import { Request, Response } from "../../comms";
|
|
5
|
-
export
|
|
6
|
-
path: string;
|
|
7
|
-
ifaceName?: string;
|
|
8
|
-
};
|
|
9
|
-
export interface DaumClassicDeviceProperties extends DeviceProperties {
|
|
3
|
+
import { Request, Response } from "../../base/comms";
|
|
4
|
+
export interface DaumClassicProperties extends DeviceProperties {
|
|
10
5
|
gear?: number;
|
|
11
6
|
}
|
|
12
7
|
export interface DaumClassicRequest extends Request {
|
|
@@ -18,8 +13,11 @@ export interface DaumClassicResponse extends Response {
|
|
|
18
13
|
data?: Uint8Array;
|
|
19
14
|
error?: Error;
|
|
20
15
|
}
|
|
21
|
-
export
|
|
22
|
-
|
|
16
|
+
export type DaumClassicStartInfo = {
|
|
17
|
+
bikeNo?: number;
|
|
18
|
+
serialNo?: string;
|
|
19
|
+
cockpit?: string;
|
|
20
|
+
};
|
|
23
21
|
export type ResponseType = 'Response' | 'Error';
|
|
24
22
|
export type DaumClassicCommsState = {
|
|
25
23
|
data: Queue<DaumClassicResponse>;
|