incyclist-devices 2.3.17 → 2.3.22
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/cad/adapter.d.ts +1 -1
- package/lib/antv2/cad/adapter.js +4 -4
- package/lib/antv2/sc/adapter.js +1 -1
- package/lib/antv2/spd/adapter.js +1 -1
- package/lib/ble/characteristics/csc/measurement.js +4 -2
- package/lib/ble/csc/adapter.js +1 -1
- package/lib/ble/csc/sensor.js +3 -1
- package/lib/ble/tacx/sensor.d.ts +2 -1
- package/lib/ble/tacx/sensor.js +3 -1
- package/lib/ble/tacx/types.d.ts +2 -1
- package/lib/modes/antble-smarttrainer.js +0 -1
- package/lib/serial/daum/premium/utils.d.ts +1 -1
- package/lib/serial/index.js +17 -7
- package/package.json +7 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CadenceSensorState, Profile } from "incyclist-ant-plus";
|
|
2
2
|
import AntAdapter from "../base/adapter";
|
|
3
3
|
import { AntDeviceProperties, AntDeviceSettings, LegacyProfile } from "../types";
|
|
4
|
-
export default class
|
|
4
|
+
export default class AntCadAdapter extends AntAdapter<CadenceSensorState> {
|
|
5
5
|
protected static INCYCLIST_PROFILE_NAME: LegacyProfile;
|
|
6
6
|
protected static ANT_PROFILE_NAME: Profile;
|
|
7
7
|
constructor(settings: AntDeviceSettings, props?: AntDeviceProperties);
|
package/lib/antv2/cad/adapter.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const adapter_1 = __importDefault(require("../base/adapter"));
|
|
7
7
|
const types_1 = require("../../types");
|
|
8
|
-
class
|
|
8
|
+
class AntCadAdapter extends adapter_1.default {
|
|
9
9
|
constructor(settings, props) {
|
|
10
10
|
super(settings, props);
|
|
11
11
|
this.capabilities = [types_1.IncyclistCapability.Cadence];
|
|
@@ -20,6 +20,6 @@ class AntHrAdapter extends adapter_1.default {
|
|
|
20
20
|
return this.deviceData.CalculatedCadence !== undefined && this.deviceData.CalculatedCadence !== null;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
exports.default =
|
|
23
|
+
AntCadAdapter.INCYCLIST_PROFILE_NAME = 'Cadence Sensor';
|
|
24
|
+
AntCadAdapter.ANT_PROFILE_NAME = 'CAD';
|
|
25
|
+
exports.default = AntCadAdapter;
|
package/lib/antv2/sc/adapter.js
CHANGED
|
@@ -8,7 +8,7 @@ const types_1 = require("../../types");
|
|
|
8
8
|
class AntSpdAdapter extends adapter_1.default {
|
|
9
9
|
mapToAdapterData(deviceData) {
|
|
10
10
|
if (deviceData.CalculatedSpeed !== undefined) {
|
|
11
|
-
this.data.speed = deviceData.CalculatedSpeed;
|
|
11
|
+
this.data.speed = deviceData.CalculatedSpeed * 3.6;
|
|
12
12
|
this.data.timestamp = Date.now();
|
|
13
13
|
}
|
|
14
14
|
if (deviceData.CalculatedDistance !== undefined) {
|
package/lib/antv2/spd/adapter.js
CHANGED
|
@@ -8,7 +8,7 @@ const types_1 = require("../../types");
|
|
|
8
8
|
class AntSpdAdapter extends adapter_1.default {
|
|
9
9
|
mapToAdapterData(deviceData) {
|
|
10
10
|
if (deviceData.CalculatedSpeed !== undefined) {
|
|
11
|
-
this.data.speed = deviceData.CalculatedSpeed;
|
|
11
|
+
this.data.speed = deviceData.CalculatedSpeed * 3.6;
|
|
12
12
|
this.data.timestamp = Date.now();
|
|
13
13
|
}
|
|
14
14
|
if (deviceData.CalculatedDistance !== undefined) {
|
|
@@ -56,7 +56,8 @@ class CscMeasurement {
|
|
|
56
56
|
}
|
|
57
57
|
if (c.revolutions < p.revolutions)
|
|
58
58
|
revs += 0x10000;
|
|
59
|
-
|
|
59
|
+
const seconds = time / 1024;
|
|
60
|
+
rpm = 60 * revs / seconds;
|
|
60
61
|
}
|
|
61
62
|
else if (p.cntUpdateMissing < 0 || p.cntUpdateMissing > 2) {
|
|
62
63
|
rpm = 0;
|
|
@@ -85,7 +86,8 @@ class CscMeasurement {
|
|
|
85
86
|
time += 0x10000;
|
|
86
87
|
this.timeOffset += 0x10000;
|
|
87
88
|
}
|
|
88
|
-
const
|
|
89
|
+
const seconds = time / 1024;
|
|
90
|
+
const rps = revs / seconds;
|
|
89
91
|
speed = rps * this.cw;
|
|
90
92
|
}
|
|
91
93
|
else if (p.cntUpdateMissing < 0 || p.cntUpdateMissing > 2) {
|
package/lib/ble/csc/adapter.js
CHANGED
package/lib/ble/csc/sensor.js
CHANGED
|
@@ -31,7 +31,9 @@ class BleCyclingSpeedCadenceDevice extends sensor_1.TBleSensor {
|
|
|
31
31
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
32
|
try {
|
|
33
33
|
const data = yield this.read(consts_1.CSC_FEATURE);
|
|
34
|
-
|
|
34
|
+
const features = this.featureParser.parse(data);
|
|
35
|
+
this.logEvent({ message: 'supported features', features, raw: data === null || data === void 0 ? void 0 : data.toString('hex') });
|
|
36
|
+
return features;
|
|
35
37
|
}
|
|
36
38
|
catch (err) {
|
|
37
39
|
this.logEvent({ message: 'read failed', characteristic: consts_1.CSC_FEATURE, reason: err.message });
|
package/lib/ble/tacx/sensor.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { CrankData } from "../cp";
|
|
|
3
3
|
import { IndoorBikeData } from "../fm";
|
|
4
4
|
import BleFitnessMachineDevice from "../fm/sensor";
|
|
5
5
|
import { BleProtocol } from "../types";
|
|
6
|
-
import { BleFeBikeData } from "./types";
|
|
6
|
+
import { BleFeBikeData, FECState } from "./types";
|
|
7
7
|
export default class TacxAdvancedFitnessMachineDevice extends BleFitnessMachineDevice {
|
|
8
8
|
static readonly profile: LegacyProfile;
|
|
9
9
|
static readonly protocol: BleProtocol;
|
|
@@ -17,6 +17,7 @@ export default class TacxAdvancedFitnessMachineDevice extends BleFitnessMachineD
|
|
|
17
17
|
protected data: BleFeBikeData;
|
|
18
18
|
protected hasFECData: boolean;
|
|
19
19
|
protected messageCnt: number;
|
|
20
|
+
protected currentState: FECState;
|
|
20
21
|
protected tacxRx: string;
|
|
21
22
|
protected tacxTx: string;
|
|
22
23
|
protected prevMessages: Record<string, {
|
package/lib/ble/tacx/sensor.js
CHANGED
|
@@ -221,7 +221,8 @@ class TacxAdvancedFitnessMachineDevice extends sensor_1.default {
|
|
|
221
221
|
break;
|
|
222
222
|
case 2:
|
|
223
223
|
this.data.State = 'READY';
|
|
224
|
-
this.
|
|
224
|
+
if (this.currentState !== 'READY')
|
|
225
|
+
this.resetState();
|
|
225
226
|
break;
|
|
226
227
|
case 3:
|
|
227
228
|
this.data.State = 'IN_USE';
|
|
@@ -235,6 +236,7 @@ class TacxAdvancedFitnessMachineDevice extends sensor_1.default {
|
|
|
235
236
|
}
|
|
236
237
|
if (capStateBF & 0x80) {
|
|
237
238
|
}
|
|
239
|
+
this.currentState = this.data.State;
|
|
238
240
|
}
|
|
239
241
|
parseGeneralFE(data) {
|
|
240
242
|
const equipmentTypeBF = data.readUInt8(1);
|
package/lib/ble/tacx/types.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { IndoorBikeData } from "../fm";
|
|
2
|
+
export type FECState = 'OFF' | 'READY' | 'IN_USE' | 'FINISHED';
|
|
2
3
|
export interface BleFeBikeData extends IndoorBikeData {
|
|
3
4
|
EquipmentType?: 'Treadmill' | 'Elliptical' | 'StationaryBike' | 'Rower' | 'Climber' | 'NordicSkier' | 'Trainer' | 'General';
|
|
4
5
|
RealSpeed?: number;
|
|
5
6
|
VirtualSpeed?: number;
|
|
6
7
|
HeartRateSource?: 'HandContact' | 'EM' | 'ANT+';
|
|
7
|
-
State?:
|
|
8
|
+
State?: FECState;
|
|
8
9
|
EventCount?: number;
|
|
9
10
|
AccumulatedPower?: number;
|
|
10
11
|
TrainerStatus?: number;
|
|
@@ -59,7 +59,6 @@ class SmartTrainerCyclingMode extends power_base_1.default {
|
|
|
59
59
|
catch (err) {
|
|
60
60
|
this.logger.logEvent({ message: "error", fn: 'sendBikeUpdate()', error: err.message, stack: err.stack });
|
|
61
61
|
}
|
|
62
|
-
console.log('#sendBikeUpdate', newRequest);
|
|
63
62
|
return newRequest;
|
|
64
63
|
}
|
|
65
64
|
}
|
|
@@ -47,5 +47,5 @@ export declare const FileTimeSupport: {
|
|
|
47
47
|
};
|
|
48
48
|
export declare function routeToEpp(route: Route, date?: Date): Uint8Array;
|
|
49
49
|
export declare function parseTrainingData(payload: string): IncyclistBikeData;
|
|
50
|
-
export declare function getPersonData(user: User): Buffer
|
|
50
|
+
export declare function getPersonData(user: User): Buffer<ArrayBuffer>;
|
|
51
51
|
export declare function parsePersonData(buffer: Buffer): User;
|
package/lib/serial/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "incyclist-devices",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.22",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@serialport/bindings-interface": "^1.2.2",
|
|
6
6
|
"@serialport/parser-byte-length": "^9.0.1",
|
|
7
7
|
"@serialport/parser-delimiter": "^9.0.1",
|
|
8
8
|
"@serialport/parser-readline": "^10.5.0",
|
|
9
9
|
"@serialport/stream": "^10.5.0",
|
|
10
|
-
"incyclist-ant-plus": "^0.3.
|
|
10
|
+
"incyclist-ant-plus": "^0.3.5",
|
|
11
11
|
"win32filetime": "^1.0.2"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
"@serialport/binding-mock": "^10.2.2",
|
|
18
18
|
"@serialport/bindings-cpp": "^10.8.0",
|
|
19
19
|
"@stoprocent/noble": "^1.15.2",
|
|
20
|
-
"@types/jest": "^29.5.
|
|
21
|
-
"@types/node": "^22.
|
|
20
|
+
"@types/jest": "^29.5.14",
|
|
21
|
+
"@types/node": "^22.15.18",
|
|
22
22
|
"bonjour-service": "^1.3.0",
|
|
23
|
-
"eslint": "^8.
|
|
23
|
+
"eslint": "^8.57.1",
|
|
24
24
|
"eslint-config-react-app": "^7.0.1",
|
|
25
25
|
"jest": "^29.7.0",
|
|
26
|
-
"ts-jest": "^29.
|
|
27
|
-
"typescript": "^5.
|
|
26
|
+
"ts-jest": "^29.3.4",
|
|
27
|
+
"typescript": "^5.8.3"
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"lint": "eslint . --ext .ts",
|