incyclist-devices 2.1.16 → 2.1.19
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/ble/ble-interface.js +7 -1
- package/lib/ble/consts.d.ts +3 -0
- package/lib/ble/consts.js +4 -1
- package/lib/ble/wahoo/comms.js +1 -1
- package/lib/serial/base/serial-interface.js +1 -2
- package/lib/serial/daum/DaumAdapter.js +1 -1
- package/lib/serial/daum/classic/comms.js +1 -1
- package/lib/serial/kettler/ergo-racer/adapter.js +1 -1
- package/lib/simulator/Simulator.js +1 -1
- package/lib/types/capabilities.d.ts +0 -1
- package/lib/types/capabilities.js +0 -1
- package/package.json +1 -1
package/lib/ble/ble-interface.js
CHANGED
|
@@ -387,6 +387,8 @@ class BleInterface extends events_1.default {
|
|
|
387
387
|
let opStr;
|
|
388
388
|
opStr = 'search device';
|
|
389
389
|
this.logEvent({ message: 'search device request', request });
|
|
390
|
+
const wasLoggingPaused = this.loggingPaused;
|
|
391
|
+
this.resumeLogging();
|
|
390
392
|
if (this.scanState.isScanning) {
|
|
391
393
|
try {
|
|
392
394
|
this.logEvent({ message: `${opStr}: waiting for previous scan to finish` });
|
|
@@ -408,6 +410,8 @@ class BleInterface extends events_1.default {
|
|
|
408
410
|
this.logEvent({ message: `${opStr} result: timeout`, request });
|
|
409
411
|
ble.removeAllListeners('discover');
|
|
410
412
|
this.logEvent({ message: `${opStr}: stop scanning`, request });
|
|
413
|
+
if (wasLoggingPaused)
|
|
414
|
+
this.pauseLogging();
|
|
411
415
|
ble.stopScanning(() => {
|
|
412
416
|
this.scanState.isScanning = false;
|
|
413
417
|
try {
|
|
@@ -440,6 +444,8 @@ class BleInterface extends events_1.default {
|
|
|
440
444
|
this.scanState.timeout = null;
|
|
441
445
|
}
|
|
442
446
|
this.logEvent({ message: `${opStr}: stop scanning`, request });
|
|
447
|
+
if (wasLoggingPaused)
|
|
448
|
+
this.pauseLogging();
|
|
443
449
|
ble.stopScanning(() => {
|
|
444
450
|
ble.removeAllListeners('discover');
|
|
445
451
|
this.scanState.isScanning = false;
|
|
@@ -464,8 +470,8 @@ class BleInterface extends events_1.default {
|
|
|
464
470
|
}
|
|
465
471
|
scan(props = {}) {
|
|
466
472
|
return __awaiter(this, void 0, void 0, function* () {
|
|
467
|
-
this.resumeLogging();
|
|
468
473
|
this.logEvent({ message: 'starting scan ..' });
|
|
474
|
+
this.resumeLogging();
|
|
469
475
|
const { timeout, protocol, protocols } = props;
|
|
470
476
|
const requestedProtocols = protocols || [];
|
|
471
477
|
if (protocol && !requestedProtocols.find(p => p === protocol))
|
package/lib/ble/consts.d.ts
CHANGED
|
@@ -5,6 +5,9 @@ export declare const FTMS = "1826";
|
|
|
5
5
|
export declare const FTMS_CP = "2ad9";
|
|
6
6
|
export declare const FTMS_STATUS = "2ada";
|
|
7
7
|
export declare const INDOOR_BIKE_DATA = "2ad2";
|
|
8
|
+
export declare const FTMS_FEATURE = "2acc";
|
|
9
|
+
export declare const RES_LEVEL_RANGE = "2ad6";
|
|
10
|
+
export declare const POWER_RANGE = "2ad8";
|
|
8
11
|
export declare const CSP = "1818";
|
|
9
12
|
export declare const CSP_MEASUREMENT = "2a63";
|
|
10
13
|
export declare const CSP_FEATURE = "2a65";
|
package/lib/ble/consts.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ELITE_TRAINER_SVC = exports.WAHOO_ADVANCED_TRAINER_CP_FULL = exports.WAHOO_ADVANCED_FTMS = exports.WAHOO_ADVANCED_TRAINER_CP = exports.CSC_MEASUREMENT = exports.CSC = exports.HR_MEASUREMENT = exports.CSP_FEATURE = exports.CSP_MEASUREMENT = exports.CSP = exports.INDOOR_BIKE_DATA = exports.FTMS_STATUS = exports.FTMS_CP = exports.FTMS = exports.TACX_FE_C_TX = exports.TACX_FE_C_RX = exports.TACX_FE_C_BLE = void 0;
|
|
3
|
+
exports.ELITE_TRAINER_SVC = exports.WAHOO_ADVANCED_TRAINER_CP_FULL = exports.WAHOO_ADVANCED_FTMS = exports.WAHOO_ADVANCED_TRAINER_CP = exports.CSC_MEASUREMENT = exports.CSC = exports.HR_MEASUREMENT = exports.CSP_FEATURE = exports.CSP_MEASUREMENT = exports.CSP = exports.POWER_RANGE = exports.RES_LEVEL_RANGE = exports.FTMS_FEATURE = exports.INDOOR_BIKE_DATA = exports.FTMS_STATUS = exports.FTMS_CP = exports.FTMS = exports.TACX_FE_C_TX = exports.TACX_FE_C_RX = exports.TACX_FE_C_BLE = void 0;
|
|
4
4
|
exports.TACX_FE_C_BLE = '6e40fec1';
|
|
5
5
|
exports.TACX_FE_C_RX = '6e40fec2';
|
|
6
6
|
exports.TACX_FE_C_TX = '6e40fec3';
|
|
@@ -8,6 +8,9 @@ exports.FTMS = '1826';
|
|
|
8
8
|
exports.FTMS_CP = '2ad9';
|
|
9
9
|
exports.FTMS_STATUS = '2ada';
|
|
10
10
|
exports.INDOOR_BIKE_DATA = '2ad2';
|
|
11
|
+
exports.FTMS_FEATURE = '2acc';
|
|
12
|
+
exports.RES_LEVEL_RANGE = '2ad6';
|
|
13
|
+
exports.POWER_RANGE = '2ad8';
|
|
11
14
|
exports.CSP = '1818';
|
|
12
15
|
exports.CSP_MEASUREMENT = '2a63';
|
|
13
16
|
exports.CSP_FEATURE = '2a65';
|
package/lib/ble/wahoo/comms.js
CHANGED
|
@@ -394,6 +394,6 @@ class BleWahooDevice extends comms_1.default {
|
|
|
394
394
|
}
|
|
395
395
|
BleWahooDevice.protocol = 'wahoo';
|
|
396
396
|
BleWahooDevice.services = [consts_2.CSP];
|
|
397
|
-
BleWahooDevice.characteristics = [
|
|
397
|
+
BleWahooDevice.characteristics = [consts_2.FTMS_FEATURE, consts_2.INDOOR_BIKE_DATA, consts_2.RES_LEVEL_RANGE, consts_2.POWER_RANGE, consts_2.FTMS_CP, consts_2.FTMS_STATUS, consts_2.WAHOO_ADVANCED_TRAINER_CP];
|
|
398
398
|
BleWahooDevice.detectionPriority = 5;
|
|
399
399
|
exports.default = BleWahooDevice;
|
|
@@ -207,8 +207,7 @@ class SerialInterface extends events_1.default {
|
|
|
207
207
|
do {
|
|
208
208
|
if (attemptNo === 0)
|
|
209
209
|
this.logEvent({ message: 'checking for ports', interface: this.ifaceName, port, excludes: this.inUse });
|
|
210
|
-
|
|
211
|
-
attemptNo++;
|
|
210
|
+
attemptNo++;
|
|
212
211
|
try {
|
|
213
212
|
if (isTcpip) {
|
|
214
213
|
const _binding = binding;
|
|
@@ -37,7 +37,7 @@ class DaumAdapter extends adapter_1.SerialIncyclistDevice {
|
|
|
37
37
|
heartrate: 0
|
|
38
38
|
};
|
|
39
39
|
this.capabilities = [
|
|
40
|
-
types_1.IncyclistCapability.Power, types_1.IncyclistCapability.Speed, types_1.IncyclistCapability.Cadence, types_1.IncyclistCapability.
|
|
40
|
+
types_1.IncyclistCapability.Power, types_1.IncyclistCapability.Speed, types_1.IncyclistCapability.Cadence, types_1.IncyclistCapability.HeartRate,
|
|
41
41
|
types_1.IncyclistCapability.Control
|
|
42
42
|
];
|
|
43
43
|
}
|
|
@@ -17,7 +17,7 @@ const comms_1 = __importDefault(require("../../base/comms"));
|
|
|
17
17
|
const utils_2 = require("./utils");
|
|
18
18
|
const types_1 = require("../types");
|
|
19
19
|
const ByteLength = require('@serialport/parser-byte-length');
|
|
20
|
-
const TIMEOUT_SEND =
|
|
20
|
+
const TIMEOUT_SEND = 1000;
|
|
21
21
|
class Daum8008 extends comms_1.default {
|
|
22
22
|
constructor(props) {
|
|
23
23
|
super(props);
|
|
@@ -29,7 +29,7 @@ class KettlerRacerAdapter extends adapter_1.SerialIncyclistDevice {
|
|
|
29
29
|
this.iv = null;
|
|
30
30
|
this.comms = new comms_1.default({ interface: settings.interface, port: settings.port, logger: this.logger });
|
|
31
31
|
this.capabilities = [
|
|
32
|
-
types_1.IncyclistCapability.Power, types_1.IncyclistCapability.Speed, types_1.IncyclistCapability.Cadence, types_1.IncyclistCapability.
|
|
32
|
+
types_1.IncyclistCapability.Power, types_1.IncyclistCapability.Speed, types_1.IncyclistCapability.Cadence, types_1.IncyclistCapability.HeartRate,
|
|
33
33
|
types_1.IncyclistCapability.Control
|
|
34
34
|
];
|
|
35
35
|
}
|
|
@@ -35,7 +35,7 @@ class Simulator extends adpater_1.default {
|
|
|
35
35
|
const modeSettings = this.isBot ? props.settings : this.getCyclingMode().getSettings();
|
|
36
36
|
this.setCyclingMode(name, modeSettings);
|
|
37
37
|
this.capabilities = [
|
|
38
|
-
types_1.IncyclistCapability.Power, types_1.IncyclistCapability.Speed, types_1.IncyclistCapability.Cadence,
|
|
38
|
+
types_1.IncyclistCapability.Power, types_1.IncyclistCapability.Speed, types_1.IncyclistCapability.Cadence,
|
|
39
39
|
types_1.IncyclistCapability.Control, types_1.IncyclistCapability.HeartRate
|
|
40
40
|
];
|
|
41
41
|
}
|
|
@@ -7,6 +7,5 @@ var IncyclistCapability;
|
|
|
7
7
|
IncyclistCapability["Speed"] = "speed";
|
|
8
8
|
IncyclistCapability["Cadence"] = "cadence";
|
|
9
9
|
IncyclistCapability["HeartRate"] = "heartrate";
|
|
10
|
-
IncyclistCapability["Gear"] = "gear";
|
|
11
10
|
IncyclistCapability["Control"] = "control";
|
|
12
11
|
})(IncyclistCapability || (exports.IncyclistCapability = IncyclistCapability = {}));
|