incyclist-devices 2.0.24 → 2.0.25
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/antv2/adapter.js
CHANGED
|
@@ -193,8 +193,9 @@ class AntAdapter extends adpater_1.default {
|
|
|
193
193
|
}
|
|
194
194
|
start(props = {}) {
|
|
195
195
|
return __awaiter(this, void 0, void 0, function* () {
|
|
196
|
-
if (this.started)
|
|
196
|
+
if (this.started && !this.stopped)
|
|
197
197
|
return true;
|
|
198
|
+
this.stopped = false;
|
|
198
199
|
const connected = yield this.connect();
|
|
199
200
|
if (!connected)
|
|
200
201
|
throw new Error(`could not start device, reason:could not connect`);
|
package/lib/antv2/fe/adapter.js
CHANGED
|
@@ -181,10 +181,13 @@ class AntFEAdapter extends adapter_1.ControllableAntAdapter {
|
|
|
181
181
|
start(props) {
|
|
182
182
|
return __awaiter(this, void 0, void 0, function* () {
|
|
183
183
|
const wasPaused = this.paused;
|
|
184
|
+
const wasStopped = this.stopped;
|
|
184
185
|
this.startProps = props || {};
|
|
185
186
|
if (wasPaused)
|
|
186
187
|
this.resume();
|
|
187
|
-
if (
|
|
188
|
+
if (wasStopped)
|
|
189
|
+
this.stopped = false;
|
|
190
|
+
if (this.started && !wasPaused && !wasStopped) {
|
|
188
191
|
return true;
|
|
189
192
|
}
|
|
190
193
|
const connected = yield this.connect();
|
package/lib/antv2/pwr/adapter.js
CHANGED
|
@@ -149,9 +149,12 @@ class AntPwrAdapter extends adapter_1.ControllableAntAdapter {
|
|
|
149
149
|
});
|
|
150
150
|
return __awaiter(this, void 0, void 0, function* () {
|
|
151
151
|
const wasPaused = this.paused;
|
|
152
|
+
const wasStopped = this.stopped;
|
|
152
153
|
if (wasPaused)
|
|
153
154
|
this.resume();
|
|
154
|
-
if (
|
|
155
|
+
if (wasStopped)
|
|
156
|
+
this.stopped = false;
|
|
157
|
+
if (this.started && !wasPaused && !wasStopped) {
|
|
155
158
|
return true;
|
|
156
159
|
}
|
|
157
160
|
return yield _super.start.call(this, props);
|
package/lib/ble/base/adapter.js
CHANGED
|
@@ -164,7 +164,13 @@ class BleAdapter extends adpater_1.default {
|
|
|
164
164
|
}
|
|
165
165
|
start(props = {}) {
|
|
166
166
|
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
-
|
|
167
|
+
const wasPaused = this.paused;
|
|
168
|
+
const wasStopped = this.stopped;
|
|
169
|
+
if (wasPaused)
|
|
170
|
+
this.resume();
|
|
171
|
+
if (wasStopped)
|
|
172
|
+
this.stopped = false;
|
|
173
|
+
if (this.started && !wasPaused && !wasStopped)
|
|
168
174
|
return true;
|
|
169
175
|
const connected = yield this.connect();
|
|
170
176
|
if (!connected)
|
package/lib/ble/fm/adapter.js
CHANGED
|
@@ -113,9 +113,12 @@ class BleFmAdapter extends adapter_1.BleControllableAdapter {
|
|
|
113
113
|
start(props = {}) {
|
|
114
114
|
return __awaiter(this, void 0, void 0, function* () {
|
|
115
115
|
const wasPaused = this.paused;
|
|
116
|
+
const wasStopped = this.stopped;
|
|
116
117
|
if (wasPaused)
|
|
117
118
|
this.resume();
|
|
118
|
-
if (
|
|
119
|
+
if (wasStopped)
|
|
120
|
+
this.stopped = false;
|
|
121
|
+
if (this.started && !wasPaused && !wasStopped)
|
|
119
122
|
return true;
|
|
120
123
|
this.logEvent(Object.assign(Object.assign({ message: 'starting device' }, this.getSettings()), { protocol: this.getProtocolName(), props, isStarted: this.started, isConnected: this.getComms().isConnected() }));
|
|
121
124
|
const { restart = wasPaused } = props;
|
package/lib/ble/tacx/adapter.js
CHANGED
|
@@ -40,7 +40,13 @@ class BleTacxFEAdapter extends fm_1.BleFmAdapter {
|
|
|
40
40
|
}
|
|
41
41
|
start(props = {}) {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
-
|
|
43
|
+
const wasPaused = this.paused;
|
|
44
|
+
const wasStopped = this.stopped;
|
|
45
|
+
if (wasPaused)
|
|
46
|
+
this.resume();
|
|
47
|
+
if (wasStopped)
|
|
48
|
+
this.stopped = false;
|
|
49
|
+
if (this.started && !wasPaused && !wasStopped)
|
|
44
50
|
return true;
|
|
45
51
|
if (this.ble.isScanning()) {
|
|
46
52
|
this.logger.logEvent({ message: 'stop previous scan', isScanning: this.ble.isScanning() });
|
package/lib/ble/wahoo/adapter.js
CHANGED
|
@@ -40,6 +40,14 @@ class BleWahooAdapter extends fm_1.BleFmAdapter {
|
|
|
40
40
|
}
|
|
41
41
|
start(props = {}) {
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
const wasPaused = this.paused;
|
|
44
|
+
const wasStopped = this.stopped;
|
|
45
|
+
if (wasPaused)
|
|
46
|
+
this.resume();
|
|
47
|
+
if (wasStopped)
|
|
48
|
+
this.stopped = false;
|
|
49
|
+
if (this.started && !wasPaused && !wasStopped)
|
|
50
|
+
return true;
|
|
43
51
|
this.logger.logEvent({ message: 'start requested', protocol: this.getProtocolName(), props });
|
|
44
52
|
try {
|
|
45
53
|
if (this.ble.isScanning()) {
|