incyclist-devices 3.0.43 → 3.0.44
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/cjs/ble/base/adapter.js +23 -5
- package/lib/cjs/ble/csc/adapter.js +5 -5
- package/lib/cjs/ble/index.js +2 -0
- package/lib/cjs/ble/openbikecontrol/adapter.js +77 -0
- package/lib/cjs/ble/openbikecontrol/consts.js +6 -0
- package/lib/cjs/ble/openbikecontrol/index.js +18 -0
- package/lib/cjs/ble/openbikecontrol/sensor.js +108 -0
- package/lib/cjs/ble/zwift/play/adapter.js +3 -0
- package/lib/cjs/direct-connect/base/interface.js +153 -14
- package/lib/cjs/direct-connect/base/peripheral.js +176 -19
- package/lib/esm/ble/base/adapter.js +24 -6
- package/lib/esm/ble/csc/adapter.js +5 -5
- package/lib/esm/ble/index.js +2 -0
- package/lib/esm/ble/openbikecontrol/adapter.js +70 -0
- package/lib/esm/ble/openbikecontrol/consts.js +3 -0
- package/lib/esm/ble/openbikecontrol/index.js +2 -0
- package/lib/esm/ble/openbikecontrol/sensor.js +104 -0
- package/lib/esm/ble/zwift/play/adapter.js +3 -0
- package/lib/esm/direct-connect/base/interface.js +155 -16
- package/lib/esm/direct-connect/base/peripheral.js +174 -18
- package/lib/types/ble/base/adapter.d.ts +3 -0
- package/lib/types/ble/csc/adapter.d.ts +1 -1
- package/lib/types/ble/openbikecontrol/adapter.d.ts +23 -0
- package/lib/types/ble/openbikecontrol/consts.d.ts +3 -0
- package/lib/types/ble/openbikecontrol/index.d.ts +2 -0
- package/lib/types/ble/openbikecontrol/sensor.d.ts +25 -0
- package/lib/types/ble/types.d.ts +2 -1
- package/lib/types/ble/zwift/play/adapter.d.ts +1 -0
- package/lib/types/direct-connect/base/interface.d.ts +9 -0
- package/lib/types/direct-connect/base/peripheral.d.ts +17 -0
- package/package.json +2 -2
|
@@ -8,6 +8,7 @@ export declare class DirectConnectPeripheral implements IBlePeripheral {
|
|
|
8
8
|
static readonly instances: Record<string, DirectConnectPeripheral>;
|
|
9
9
|
static create(announcement: MulticastDnsAnnouncement): DirectConnectPeripheral;
|
|
10
10
|
protected socket: Socket;
|
|
11
|
+
protected socketConnected: boolean;
|
|
11
12
|
protected connectTask: InteruptableTask<TaskState, boolean>;
|
|
12
13
|
protected msgSeqNo: number;
|
|
13
14
|
protected onDataHandler: any;
|
|
@@ -28,6 +29,7 @@ export declare class DirectConnectPeripheral implements IBlePeripheral {
|
|
|
28
29
|
connect(): Promise<boolean>;
|
|
29
30
|
disconnect(connectionLost?: boolean): Promise<boolean>;
|
|
30
31
|
isConnected(): boolean;
|
|
32
|
+
protected discardSocket(): void;
|
|
31
33
|
isConnecting(): boolean;
|
|
32
34
|
onDisconnect(callback: () => void): void;
|
|
33
35
|
discoverServices(): Promise<string[]>;
|
|
@@ -53,3 +55,18 @@ export declare class DirectConnectPeripheral implements IBlePeripheral {
|
|
|
53
55
|
protected logEvent(event: any): void;
|
|
54
56
|
protected getBinding(): DirectConnectBinding;
|
|
55
57
|
}
|
|
58
|
+
export declare class OpenBikeControlPeripheral extends DirectConnectPeripheral {
|
|
59
|
+
static readonly instances: Record<string, OpenBikeControlPeripheral>;
|
|
60
|
+
static create(announcement: MulticastDnsAnnouncement): OpenBikeControlPeripheral;
|
|
61
|
+
discoverServices(): Promise<string[]>;
|
|
62
|
+
discoverCharacteristics(_serviceUUID: string): Promise<BleCharacteristic[]>;
|
|
63
|
+
subscribe(characteristicUUID: string, callback?: (characteristicUuid: string, data: Buffer) => void): Promise<boolean>;
|
|
64
|
+
unsubscribe(characteristicUUID: string): Promise<boolean>;
|
|
65
|
+
read(_characteristicUUID: string): Promise<Buffer>;
|
|
66
|
+
write(characteristicUUID: string, data: Buffer, _options?: BleWriteProps): Promise<Buffer>;
|
|
67
|
+
protected pending?: Buffer;
|
|
68
|
+
disconnect(connectionLost?: boolean): Promise<boolean>;
|
|
69
|
+
protected onData(data: Buffer): Promise<void>;
|
|
70
|
+
protected getButtonStateEnd(buffer: Buffer, offset: number): number;
|
|
71
|
+
protected isMessageType(byte: number): boolean;
|
|
72
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "incyclist-devices",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.44",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"lint": "eslint . --ext .ts",
|
|
6
6
|
"build": "npm run build:esm && npm run build:cjs",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
9
9
|
"test": "vitest run",
|
|
10
10
|
"test:unit": "vitest run --coverage",
|
|
11
|
-
"test:ci": "vitest run--coverage",
|
|
11
|
+
"test:ci": "vitest run --coverage",
|
|
12
12
|
"dev": "tsc -p tsconfig.esm.json --watch",
|
|
13
13
|
"postversion": "git push && git push --tags",
|
|
14
14
|
"protogen": "protoc --ts_out src/proto --proto_path protos protos/*.proto "
|