brilliantsole 0.0.25 → 0.0.27
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/README.md +16 -10
- package/assets/3d/rightHand.glb +0 -0
- package/assets/images/ukaton-pressure-0.svg +9 -0
- package/assets/images/ukaton-pressure-1.svg +9 -0
- package/assets/images/ukaton-pressure-10.svg +9 -0
- package/assets/images/ukaton-pressure-11.svg +9 -0
- package/assets/images/ukaton-pressure-12.svg +9 -0
- package/assets/images/ukaton-pressure-13.svg +9 -0
- package/assets/images/ukaton-pressure-14.svg +9 -0
- package/assets/images/ukaton-pressure-15.svg +9 -0
- package/assets/images/ukaton-pressure-2.svg +9 -0
- package/assets/images/ukaton-pressure-3.svg +9 -0
- package/assets/images/ukaton-pressure-4.svg +9 -0
- package/assets/images/ukaton-pressure-5.svg +9 -0
- package/assets/images/ukaton-pressure-6.svg +9 -0
- package/assets/images/ukaton-pressure-7.svg +9 -0
- package/assets/images/ukaton-pressure-8.svg +9 -0
- package/assets/images/ukaton-pressure-9.svg +9 -0
- package/assets/images/ukaton-right-insole.svg +798 -0
- package/build/brilliantsole.cjs +255 -119
- package/build/brilliantsole.cjs.map +1 -1
- package/build/brilliantsole.js +283 -140
- package/build/brilliantsole.js.map +1 -1
- package/build/brilliantsole.ls.js +210 -103
- package/build/brilliantsole.ls.js.map +1 -1
- package/build/brilliantsole.min.js +1 -1
- package/build/brilliantsole.min.js.map +1 -1
- package/build/brilliantsole.module.d.ts +76 -60
- package/build/brilliantsole.module.js +282 -140
- package/build/brilliantsole.module.js.map +1 -1
- package/build/brilliantsole.module.min.d.ts +76 -60
- package/build/brilliantsole.module.min.js +1 -1
- package/build/brilliantsole.module.min.js.map +1 -1
- package/build/brilliantsole.node.module.d.ts +75 -60
- package/build/brilliantsole.node.module.js +254 -119
- package/build/brilliantsole.node.module.js.map +1 -1
- package/build/dts/BS.d.ts +2 -2
- package/build/dts/Device.d.ts +11 -7
- package/build/dts/DeviceManager.d.ts +1 -0
- package/build/dts/InformationManager.d.ts +6 -5
- package/build/dts/connection/BaseConnectionManager.d.ts +2 -0
- package/build/dts/connection/ClientConnectionManager.d.ts +4 -0
- package/build/dts/connection/bluetooth/BluetoothConnectionManager.d.ts +1 -0
- package/build/dts/connection/bluetooth/NobleConnectionManager.d.ts +1 -0
- package/build/dts/connection/bluetooth/WebBluetoothConnectionManager.d.ts +1 -0
- package/build/dts/devicePair/DevicePair.d.ts +14 -10
- package/build/dts/devicePair/DevicePairPressureSensorDataManager.d.ts +8 -4
- package/build/dts/devicePair/DevicePairSensorDataManager.d.ts +2 -2
- package/build/dts/server/BaseClient.d.ts +1 -0
- package/build/dts/utils/CenterOfPressureHelper.d.ts +2 -2
- package/build/dts/utils/MathUtils.d.ts +2 -0
- package/build/index.d.ts +76 -60
- package/build/index.node.d.ts +75 -60
- package/examples/3d/script.js +90 -17
- package/examples/balance/script.js +2 -1
- package/examples/basic/index.html +21 -2
- package/examples/basic/script.js +17 -3
- package/examples/bottango/index.html +11 -1
- package/examples/bottango/script.js +2 -2
- package/examples/center-of-pressure/index.html +114 -114
- package/examples/center-of-pressure/script.js +1 -1
- package/examples/device-pair/index.html +58 -58
- package/examples/device-pair/script.js +12 -8
- package/examples/gloves/index.html +116 -0
- package/examples/gloves/scene.html +124 -0
- package/examples/gloves/script.js +615 -0
- package/examples/graph/index.html +11 -1
- package/examples/graph/script.js +2 -2
- package/examples/pressure/index.html +180 -12
- package/examples/pressure/script.js +144 -7
- package/examples/recording/index.html +191 -183
- package/examples/server/index.html +11 -1
- package/examples/server/script.js +6 -3
- package/examples/ukaton-firmware-update/index.html +20 -0
- package/examples/ukaton-firmware-update/manifest.json +11 -0
- package/examples/ukaton-firmware-update/merged-firmware.bin +0 -0
- package/examples/webxr/script.js +3 -3
- package/package.json +1 -1
- package/src/BS.ts +3 -8
- package/src/Device.ts +41 -8
- package/src/DeviceInformationManager.ts +4 -2
- package/src/DeviceManager.ts +10 -1
- package/src/FileTransferManager.ts +1 -1
- package/src/FirmwareManager.ts +1 -1
- package/src/InformationManager.ts +24 -7
- package/src/TfliteManager.ts +1 -1
- package/src/connection/BaseConnectionManager.ts +23 -6
- package/src/connection/ClientConnectionManager.ts +13 -1
- package/src/connection/bluetooth/BluetoothConnectionManager.ts +6 -1
- package/src/connection/bluetooth/NobleConnectionManager.ts +8 -1
- package/src/connection/bluetooth/WebBluetoothConnectionManager.ts +5 -1
- package/src/devicePair/DevicePair.ts +53 -27
- package/src/devicePair/DevicePairPressureSensorDataManager.ts +51 -23
- package/src/devicePair/DevicePairSensorDataManager.ts +5 -5
- package/src/scanner/NobleScanner.ts +5 -3
- package/src/sensor/BarometerSensorDataManager.ts +1 -1
- package/src/sensor/MotionSensorDataManager.ts +1 -1
- package/src/sensor/PressureSensorDataManager.ts +13 -8
- package/src/sensor/SensorConfigurationManager.ts +3 -3
- package/src/sensor/SensorDataManager.ts +1 -1
- package/src/server/BaseClient.ts +43 -2
- package/src/server/BaseServer.ts +149 -39
- package/src/server/udp/UDPServer.ts +1 -1
- package/src/server/websocket/WebSocketClient.ts +3 -2
- package/src/server/websocket/WebSocketServer.ts +1 -1
- package/src/utils/CenterOfPressureHelper.ts +5 -5
- package/src/utils/MathUtils.ts +31 -1
- package/src/utils/ParseUtils.ts +1 -1
- package/src/utils/checksum.ts +1 -1
- package/src/utils/mcumgr.js +1 -1
|
@@ -38,6 +38,43 @@ declare namespace environment_d {
|
|
|
38
38
|
export { environment_d_isAndroid as isAndroid, environment_d_isBluetoothSupported as isBluetoothSupported, environment_d_isIOS as isIOS, environment_d_isInBluefy as isInBluefy, environment_d_isInBrowser as isInBrowser, environment_d_isInDev as isInDev, environment_d_isInLensStudio as isInLensStudio, environment_d_isInNode as isInNode, environment_d_isInProduction as isInProduction, environment_d_isInWebBLE as isInWebBLE, environment_d_isMac as isMac, environment_d_isSafari as isSafari };
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
declare class RangeHelper {
|
|
42
|
+
#private;
|
|
43
|
+
get min(): number;
|
|
44
|
+
get max(): number;
|
|
45
|
+
set min(newMin: number);
|
|
46
|
+
set max(newMax: number);
|
|
47
|
+
reset(): void;
|
|
48
|
+
update(value: number): void;
|
|
49
|
+
getNormalization(value: number, weightByRange: boolean): number;
|
|
50
|
+
updateAndGetNormalization(value: number, weightByRange: boolean): number;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
type CenterOfPressure = Vector2;
|
|
54
|
+
|
|
55
|
+
type PressureSensorPosition = Vector2;
|
|
56
|
+
|
|
57
|
+
interface PressureSensorValue {
|
|
58
|
+
position: PressureSensorPosition;
|
|
59
|
+
rawValue: number;
|
|
60
|
+
scaledValue: number;
|
|
61
|
+
normalizedValue: number;
|
|
62
|
+
weightedValue: number;
|
|
63
|
+
}
|
|
64
|
+
interface PressureData {
|
|
65
|
+
sensors: PressureSensorValue[];
|
|
66
|
+
scaledSum: number;
|
|
67
|
+
normalizedSum: number;
|
|
68
|
+
center?: CenterOfPressure;
|
|
69
|
+
normalizedCenter?: CenterOfPressure;
|
|
70
|
+
}
|
|
71
|
+
interface PressureDataEventMessages {
|
|
72
|
+
pressure: {
|
|
73
|
+
pressure: PressureData;
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
declare const DefaultNumberOfPressureSensors = 8;
|
|
77
|
+
|
|
41
78
|
interface Vector2 {
|
|
42
79
|
x: number;
|
|
43
80
|
y: number;
|
|
@@ -139,43 +176,6 @@ interface FirmwareEventMessages {
|
|
|
139
176
|
};
|
|
140
177
|
}
|
|
141
178
|
|
|
142
|
-
declare class RangeHelper {
|
|
143
|
-
#private;
|
|
144
|
-
get min(): number;
|
|
145
|
-
get max(): number;
|
|
146
|
-
set min(newMin: number);
|
|
147
|
-
set max(newMax: number);
|
|
148
|
-
reset(): void;
|
|
149
|
-
update(value: number): void;
|
|
150
|
-
getNormalization(value: number, weightByRange: boolean): number;
|
|
151
|
-
updateAndGetNormalization(value: number, weightByRange: boolean): number;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
type CenterOfPressure = Vector2;
|
|
155
|
-
|
|
156
|
-
type PressureSensorPosition = Vector2;
|
|
157
|
-
|
|
158
|
-
interface PressureSensorValue {
|
|
159
|
-
position: PressureSensorPosition;
|
|
160
|
-
rawValue: number;
|
|
161
|
-
scaledValue: number;
|
|
162
|
-
normalizedValue: number;
|
|
163
|
-
weightedValue: number;
|
|
164
|
-
}
|
|
165
|
-
interface PressureData {
|
|
166
|
-
sensors: PressureSensorValue[];
|
|
167
|
-
scaledSum: number;
|
|
168
|
-
normalizedSum: number;
|
|
169
|
-
center?: CenterOfPressure;
|
|
170
|
-
normalizedCenter?: CenterOfPressure;
|
|
171
|
-
}
|
|
172
|
-
interface PressureDataEventMessages {
|
|
173
|
-
pressure: {
|
|
174
|
-
pressure: PressureData;
|
|
175
|
-
};
|
|
176
|
-
}
|
|
177
|
-
declare const DefaultNumberOfPressureSensors = 8;
|
|
178
|
-
|
|
179
179
|
type ValueOf<T> = T[keyof T];
|
|
180
180
|
type AddProperty<T, Key extends string, Value> = T & {
|
|
181
181
|
[K in Key]: Value;
|
|
@@ -380,12 +380,14 @@ declare abstract class BaseConnectionManager {
|
|
|
380
380
|
protected get baseConstructor(): typeof BaseConnectionManager;
|
|
381
381
|
static get isSupported(): boolean;
|
|
382
382
|
get isSupported(): boolean;
|
|
383
|
+
get canUpdateFirmware(): boolean;
|
|
383
384
|
static type: ConnectionType;
|
|
384
385
|
get type(): ConnectionType;
|
|
385
386
|
constructor();
|
|
386
387
|
get status(): "notConnected" | "connecting" | "connected" | "disconnecting";
|
|
387
388
|
protected set status(newConnectionStatus: "notConnected" | "connecting" | "connected" | "disconnecting");
|
|
388
389
|
get isConnected(): boolean;
|
|
390
|
+
get isAvailable(): boolean;
|
|
389
391
|
connect(): Promise<void>;
|
|
390
392
|
get canReconnect(): boolean;
|
|
391
393
|
reconnect(): Promise<void>;
|
|
@@ -482,10 +484,10 @@ interface FileTransferEventMessages {
|
|
|
482
484
|
};
|
|
483
485
|
}
|
|
484
486
|
|
|
485
|
-
declare const DeviceTypes: readonly ["leftInsole", "rightInsole"];
|
|
487
|
+
declare const DeviceTypes: readonly ["leftInsole", "rightInsole", "leftGlove", "rightGlove", "glasses", "generic"];
|
|
486
488
|
type DeviceType = (typeof DeviceTypes)[number];
|
|
487
|
-
declare const
|
|
488
|
-
type
|
|
489
|
+
declare const Sides: readonly ["left", "right"];
|
|
490
|
+
type Side = (typeof Sides)[number];
|
|
489
491
|
declare const MinNameLength = 2;
|
|
490
492
|
declare const MaxNameLength = 30;
|
|
491
493
|
declare const InformationMessageTypes: readonly ["isCharging", "getBatteryCurrent", "getMtu", "getId", "getName", "setName", "getType", "setType", "getCurrentTime", "setCurrentTime"];
|
|
@@ -534,12 +536,13 @@ declare class InformationManager {
|
|
|
534
536
|
get name(): string;
|
|
535
537
|
updateName(updatedName: string): void;
|
|
536
538
|
setName(newName: string): Promise<void>;
|
|
537
|
-
get type(): "leftInsole" | "rightInsole";
|
|
539
|
+
get type(): "leftInsole" | "rightInsole" | "leftGlove" | "rightGlove" | "glasses" | "generic";
|
|
538
540
|
get typeEnum(): number;
|
|
539
541
|
updateType(updatedType: DeviceType): void;
|
|
540
542
|
setType(newType: DeviceType): Promise<void>;
|
|
541
543
|
get isInsole(): boolean;
|
|
542
|
-
get
|
|
544
|
+
get isGlove(): boolean;
|
|
545
|
+
get side(): Side;
|
|
543
546
|
get mtu(): number;
|
|
544
547
|
get isCurrentTimeSet(): boolean;
|
|
545
548
|
parseMessage(messageType: InformationMessageType, dataView: DataView): void;
|
|
@@ -568,25 +571,26 @@ type BoundDeviceEventListeners = BoundEventListeners<Device, DeviceEventType, De
|
|
|
568
571
|
declare class Device {
|
|
569
572
|
#private;
|
|
570
573
|
get bluetoothId(): string | undefined;
|
|
574
|
+
get isAvailable(): boolean | undefined;
|
|
571
575
|
constructor();
|
|
572
|
-
get addEventListener(): <T extends "maxFileLength" | "getFileType" | "setFileType" | "getFileLength" | "setFileLength" | "getFileChecksum" | "setFileChecksum" | "setFileTransferCommand" | "fileTransferStatus" | "getFileBlock" | "setFileBlock" | "fileBytesTransferred" | "fileTransferProgress" | "fileTransferComplete" | "fileReceived" | "
|
|
576
|
+
get addEventListener(): <T extends "pressure" | "maxFileLength" | "getFileType" | "setFileType" | "getFileLength" | "setFileLength" | "getFileChecksum" | "setFileChecksum" | "setFileTransferCommand" | "fileTransferStatus" | "getFileBlock" | "setFileBlock" | "fileBytesTransferred" | "fileTransferProgress" | "fileTransferComplete" | "fileReceived" | "acceleration" | "gravity" | "linearAcceleration" | "gyroscope" | "magnetometer" | "gameRotation" | "rotation" | "orientation" | "activity" | "stepCounter" | "stepDetector" | "deviceOrientation" | "barometer" | "getPressurePositions" | "getSensorScalars" | "sensorData" | "getSensorConfiguration" | "setSensorConfiguration" | "getTfliteName" | "setTfliteName" | "getTfliteTask" | "setTfliteTask" | "getTfliteSampleRate" | "setTfliteSampleRate" | "getTfliteSensorTypes" | "setTfliteSensorTypes" | "tfliteIsReady" | "getTfliteCaptureDelay" | "setTfliteCaptureDelay" | "getTfliteThreshold" | "setTfliteThreshold" | "getTfliteInferencingEnabled" | "setTfliteInferencingEnabled" | "tfliteInference" | "manufacturerName" | "modelNumber" | "softwareRevision" | "hardwareRevision" | "firmwareRevision" | "pnpId" | "serialNumber" | "deviceInformation" | "isCharging" | "getBatteryCurrent" | "getMtu" | "getId" | "getName" | "setName" | "getType" | "setType" | "getCurrentTime" | "setCurrentTime" | "notConnected" | "connecting" | "connected" | "disconnecting" | "connectionStatus" | "isConnected" | "smp" | "batteryLevel" | "rx" | "tx" | "firmwareImages" | "firmwareUploadProgress" | "firmwareStatus" | "firmwareUploadComplete" | "connectionMessage">(type: T, listener: (event: {
|
|
573
577
|
type: T;
|
|
574
578
|
target: Device;
|
|
575
579
|
message: DeviceEventMessages[T];
|
|
576
580
|
}) => void, options?: {
|
|
577
581
|
once?: boolean;
|
|
578
582
|
}) => void;
|
|
579
|
-
get removeEventListener(): <T extends "maxFileLength" | "getFileType" | "setFileType" | "getFileLength" | "setFileLength" | "getFileChecksum" | "setFileChecksum" | "setFileTransferCommand" | "fileTransferStatus" | "getFileBlock" | "setFileBlock" | "fileBytesTransferred" | "fileTransferProgress" | "fileTransferComplete" | "fileReceived" | "
|
|
583
|
+
get removeEventListener(): <T extends "pressure" | "maxFileLength" | "getFileType" | "setFileType" | "getFileLength" | "setFileLength" | "getFileChecksum" | "setFileChecksum" | "setFileTransferCommand" | "fileTransferStatus" | "getFileBlock" | "setFileBlock" | "fileBytesTransferred" | "fileTransferProgress" | "fileTransferComplete" | "fileReceived" | "acceleration" | "gravity" | "linearAcceleration" | "gyroscope" | "magnetometer" | "gameRotation" | "rotation" | "orientation" | "activity" | "stepCounter" | "stepDetector" | "deviceOrientation" | "barometer" | "getPressurePositions" | "getSensorScalars" | "sensorData" | "getSensorConfiguration" | "setSensorConfiguration" | "getTfliteName" | "setTfliteName" | "getTfliteTask" | "setTfliteTask" | "getTfliteSampleRate" | "setTfliteSampleRate" | "getTfliteSensorTypes" | "setTfliteSensorTypes" | "tfliteIsReady" | "getTfliteCaptureDelay" | "setTfliteCaptureDelay" | "getTfliteThreshold" | "setTfliteThreshold" | "getTfliteInferencingEnabled" | "setTfliteInferencingEnabled" | "tfliteInference" | "manufacturerName" | "modelNumber" | "softwareRevision" | "hardwareRevision" | "firmwareRevision" | "pnpId" | "serialNumber" | "deviceInformation" | "isCharging" | "getBatteryCurrent" | "getMtu" | "getId" | "getName" | "setName" | "getType" | "setType" | "getCurrentTime" | "setCurrentTime" | "notConnected" | "connecting" | "connected" | "disconnecting" | "connectionStatus" | "isConnected" | "smp" | "batteryLevel" | "rx" | "tx" | "firmwareImages" | "firmwareUploadProgress" | "firmwareStatus" | "firmwareUploadComplete" | "connectionMessage">(type: T, listener: (event: {
|
|
580
584
|
type: T;
|
|
581
585
|
target: Device;
|
|
582
586
|
message: DeviceEventMessages[T];
|
|
583
587
|
}) => void) => void;
|
|
584
|
-
get waitForEvent(): <T extends "maxFileLength" | "getFileType" | "setFileType" | "getFileLength" | "setFileLength" | "getFileChecksum" | "setFileChecksum" | "setFileTransferCommand" | "fileTransferStatus" | "getFileBlock" | "setFileBlock" | "fileBytesTransferred" | "fileTransferProgress" | "fileTransferComplete" | "fileReceived" | "
|
|
588
|
+
get waitForEvent(): <T extends "pressure" | "maxFileLength" | "getFileType" | "setFileType" | "getFileLength" | "setFileLength" | "getFileChecksum" | "setFileChecksum" | "setFileTransferCommand" | "fileTransferStatus" | "getFileBlock" | "setFileBlock" | "fileBytesTransferred" | "fileTransferProgress" | "fileTransferComplete" | "fileReceived" | "acceleration" | "gravity" | "linearAcceleration" | "gyroscope" | "magnetometer" | "gameRotation" | "rotation" | "orientation" | "activity" | "stepCounter" | "stepDetector" | "deviceOrientation" | "barometer" | "getPressurePositions" | "getSensorScalars" | "sensorData" | "getSensorConfiguration" | "setSensorConfiguration" | "getTfliteName" | "setTfliteName" | "getTfliteTask" | "setTfliteTask" | "getTfliteSampleRate" | "setTfliteSampleRate" | "getTfliteSensorTypes" | "setTfliteSensorTypes" | "tfliteIsReady" | "getTfliteCaptureDelay" | "setTfliteCaptureDelay" | "getTfliteThreshold" | "setTfliteThreshold" | "getTfliteInferencingEnabled" | "setTfliteInferencingEnabled" | "tfliteInference" | "manufacturerName" | "modelNumber" | "softwareRevision" | "hardwareRevision" | "firmwareRevision" | "pnpId" | "serialNumber" | "deviceInformation" | "isCharging" | "getBatteryCurrent" | "getMtu" | "getId" | "getName" | "setName" | "getType" | "setType" | "getCurrentTime" | "setCurrentTime" | "notConnected" | "connecting" | "connected" | "disconnecting" | "connectionStatus" | "isConnected" | "smp" | "batteryLevel" | "rx" | "tx" | "firmwareImages" | "firmwareUploadProgress" | "firmwareStatus" | "firmwareUploadComplete" | "connectionMessage">(type: T) => Promise<{
|
|
585
589
|
type: T;
|
|
586
590
|
target: Device;
|
|
587
591
|
message: DeviceEventMessages[T];
|
|
588
592
|
}>;
|
|
589
|
-
get removeEventListeners(): <T extends "maxFileLength" | "getFileType" | "setFileType" | "getFileLength" | "setFileLength" | "getFileChecksum" | "setFileChecksum" | "setFileTransferCommand" | "fileTransferStatus" | "getFileBlock" | "setFileBlock" | "fileBytesTransferred" | "fileTransferProgress" | "fileTransferComplete" | "fileReceived" | "
|
|
593
|
+
get removeEventListeners(): <T extends "pressure" | "maxFileLength" | "getFileType" | "setFileType" | "getFileLength" | "setFileLength" | "getFileChecksum" | "setFileChecksum" | "setFileTransferCommand" | "fileTransferStatus" | "getFileBlock" | "setFileBlock" | "fileBytesTransferred" | "fileTransferProgress" | "fileTransferComplete" | "fileReceived" | "acceleration" | "gravity" | "linearAcceleration" | "gyroscope" | "magnetometer" | "gameRotation" | "rotation" | "orientation" | "activity" | "stepCounter" | "stepDetector" | "deviceOrientation" | "barometer" | "getPressurePositions" | "getSensorScalars" | "sensorData" | "getSensorConfiguration" | "setSensorConfiguration" | "getTfliteName" | "setTfliteName" | "getTfliteTask" | "setTfliteTask" | "getTfliteSampleRate" | "setTfliteSampleRate" | "getTfliteSensorTypes" | "setTfliteSensorTypes" | "tfliteIsReady" | "getTfliteCaptureDelay" | "setTfliteCaptureDelay" | "getTfliteThreshold" | "setTfliteThreshold" | "getTfliteInferencingEnabled" | "setTfliteInferencingEnabled" | "tfliteInference" | "manufacturerName" | "modelNumber" | "softwareRevision" | "hardwareRevision" | "firmwareRevision" | "pnpId" | "serialNumber" | "deviceInformation" | "isCharging" | "getBatteryCurrent" | "getMtu" | "getId" | "getName" | "setName" | "getType" | "setType" | "getCurrentTime" | "setCurrentTime" | "notConnected" | "connecting" | "connected" | "disconnecting" | "connectionStatus" | "isConnected" | "smp" | "batteryLevel" | "rx" | "tx" | "firmwareImages" | "firmwareUploadProgress" | "firmwareStatus" | "firmwareUploadComplete" | "connectionMessage">(type: T) => void;
|
|
590
594
|
get removeAllEventListeners(): () => void;
|
|
591
595
|
get connectionManager(): BaseConnectionManager | undefined;
|
|
592
596
|
set connectionManager(newConnectionManager: BaseConnectionManager | undefined);
|
|
@@ -605,7 +609,7 @@ declare class Device {
|
|
|
605
609
|
toggleConnection(): void;
|
|
606
610
|
get connectionStatus(): ConnectionStatus;
|
|
607
611
|
get isConnectionBusy(): boolean;
|
|
608
|
-
|
|
612
|
+
latestConnectionMessages: Map<ConnectionMessageType, DataView>;
|
|
609
613
|
get deviceInformation(): DeviceInformation;
|
|
610
614
|
get batteryLevel(): number;
|
|
611
615
|
/** @private */
|
|
@@ -616,10 +620,11 @@ declare class Device {
|
|
|
616
620
|
get getBatteryCurrent(): () => Promise<void>;
|
|
617
621
|
get name(): string;
|
|
618
622
|
get setName(): (newName: string) => Promise<void>;
|
|
619
|
-
get type(): "leftInsole" | "rightInsole";
|
|
623
|
+
get type(): "leftInsole" | "rightInsole" | "leftGlove" | "rightGlove" | "glasses" | "generic";
|
|
620
624
|
get setType(): (newType: DeviceType) => Promise<void>;
|
|
621
625
|
get isInsole(): boolean;
|
|
622
|
-
get
|
|
626
|
+
get isGlove(): boolean;
|
|
627
|
+
get side(): "left" | "right";
|
|
623
628
|
get mtu(): number;
|
|
624
629
|
get sensorTypes(): SensorType[];
|
|
625
630
|
get continuousSensorTypes(): ("pressure" | "acceleration" | "gravity" | "linearAcceleration" | "gyroscope" | "magnetometer" | "gameRotation" | "rotation" | "barometer")[];
|
|
@@ -657,6 +662,7 @@ declare class Device {
|
|
|
657
662
|
get setTfliteCaptureDelay(): (newCaptureDelay: number, sendImmediately: boolean) => Promise<void>;
|
|
658
663
|
get tfliteThreshold(): number;
|
|
659
664
|
get setTfliteThreshold(): (newThreshold: number, sendImmediately: boolean) => Promise<void>;
|
|
665
|
+
get canUpdateFirmware(): boolean | undefined;
|
|
660
666
|
private sendSmpMessage;
|
|
661
667
|
get uploadFirmware(): (file: FileLike) => Promise<void>;
|
|
662
668
|
reset(): Promise<void>;
|
|
@@ -668,6 +674,7 @@ declare class Device {
|
|
|
668
674
|
get testFirmwareImage(): (imageIndex?: number) => Promise<void>;
|
|
669
675
|
get isServerSide(): boolean;
|
|
670
676
|
set isServerSide(newIsServerSide: boolean);
|
|
677
|
+
get isUkaton(): boolean;
|
|
671
678
|
}
|
|
672
679
|
|
|
673
680
|
declare const DeviceManagerEventTypes: readonly ["deviceConnected", "deviceDisconnected", "deviceIsConnected", "availableDevices", "connectedDevices"];
|
|
@@ -724,11 +731,15 @@ declare class DeviceManager {
|
|
|
724
731
|
}) => void) => void;
|
|
725
732
|
get RemoveEventListeners(): <T extends "deviceConnected" | "deviceDisconnected" | "deviceIsConnected" | "availableDevices" | "connectedDevices">(type: T) => void;
|
|
726
733
|
get RemoveAllEventListeners(): () => void;
|
|
734
|
+
_CheckDeviceAvailability(device: Device): void;
|
|
727
735
|
}
|
|
728
736
|
declare const _default: DeviceManager;
|
|
729
737
|
|
|
730
738
|
interface DevicePairPressureData {
|
|
731
|
-
|
|
739
|
+
sensors: {
|
|
740
|
+
[key in Side]: PressureSensorValue[];
|
|
741
|
+
};
|
|
742
|
+
scaledSum: number;
|
|
732
743
|
normalizedSum: number;
|
|
733
744
|
center?: CenterOfPressure;
|
|
734
745
|
normalizedCenter?: CenterOfPressure;
|
|
@@ -741,7 +752,7 @@ interface DevicePairPressureDataEventMessages {
|
|
|
741
752
|
}
|
|
742
753
|
|
|
743
754
|
type DevicePairSensorDataTimestamps = {
|
|
744
|
-
[
|
|
755
|
+
[side in Side]: number;
|
|
745
756
|
};
|
|
746
757
|
interface BaseDevicePairSensorDataEventMessage {
|
|
747
758
|
timestamps: DevicePairSensorDataTimestamps;
|
|
@@ -756,7 +767,7 @@ type DevicePairSensorDataEventMessages = _DevicePairSensorDataEventMessages & An
|
|
|
756
767
|
|
|
757
768
|
interface BaseDevicePairDeviceEventMessage {
|
|
758
769
|
device: Device;
|
|
759
|
-
side:
|
|
770
|
+
side: Side;
|
|
760
771
|
}
|
|
761
772
|
type DevicePairDeviceEventMessages = ExtendInterfaceValues<AddPrefixToInterfaceKeys<DeviceEventMessages, "device">, BaseDevicePairDeviceEventMessage>;
|
|
762
773
|
interface DevicePairConnectionEventMessages {
|
|
@@ -769,39 +780,43 @@ type DevicePairEventMap = EventMap<DevicePair, DeviceEventType, DevicePairEventM
|
|
|
769
780
|
type DevicePairEventListenerMap = EventListenerMap<DevicePair, DeviceEventType, DevicePairEventMessages>;
|
|
770
781
|
type DevicePairEvent = Event<DevicePair, DeviceEventType, DevicePairEventMessages>;
|
|
771
782
|
type BoundDevicePairEventListeners = BoundEventListeners<DevicePair, DeviceEventType, DevicePairEventMessages>;
|
|
783
|
+
declare const DevicePairTypes: readonly ["insoles", "gloves"];
|
|
784
|
+
type DevicePairType = (typeof DevicePairTypes)[number];
|
|
772
785
|
declare class DevicePair {
|
|
773
786
|
#private;
|
|
774
|
-
constructor();
|
|
787
|
+
constructor(type: DevicePairType);
|
|
775
788
|
get sides(): readonly ["left", "right"];
|
|
776
|
-
get
|
|
789
|
+
get type(): "insoles" | "gloves";
|
|
790
|
+
get addEventListener(): <T extends "pressure" | "deviceOrientation" | "sensorData" | "isConnected" | "deviceConnected" | "deviceIsConnected" | "devicePressure" | "deviceMaxFileLength" | "deviceGetFileType" | "deviceGetFileLength" | "deviceGetFileChecksum" | "deviceFileTransferStatus" | "deviceGetFileBlock" | "deviceFileTransferProgress" | "deviceFileTransferComplete" | "deviceFileReceived" | "deviceAcceleration" | "deviceGravity" | "deviceLinearAcceleration" | "deviceGyroscope" | "deviceMagnetometer" | "deviceGameRotation" | "deviceRotation" | "deviceActivity" | "deviceStepCounter" | "deviceStepDetector" | "deviceDeviceOrientation" | "deviceBarometer" | "deviceSensorData" | "deviceGetSensorConfiguration" | "deviceGetTfliteName" | "deviceGetTfliteTask" | "deviceGetTfliteSampleRate" | "deviceGetTfliteSensorTypes" | "deviceTfliteIsReady" | "deviceGetTfliteCaptureDelay" | "deviceGetTfliteThreshold" | "deviceGetTfliteInferencingEnabled" | "deviceTfliteInference" | "deviceManufacturerName" | "deviceModelNumber" | "deviceSoftwareRevision" | "deviceHardwareRevision" | "deviceFirmwareRevision" | "devicePnpId" | "deviceSerialNumber" | "deviceDeviceInformation" | "deviceIsCharging" | "deviceGetBatteryCurrent" | "deviceGetMtu" | "deviceGetId" | "deviceGetName" | "deviceGetType" | "deviceGetCurrentTime" | "deviceNotConnected" | "deviceConnecting" | "deviceDisconnecting" | "deviceConnectionStatus" | "deviceSmp" | "deviceBatteryLevel" | "deviceFirmwareImages" | "deviceFirmwareUploadProgress" | "deviceFirmwareStatus" | "deviceConnectionMessage">(type: T, listener: (event: {
|
|
777
791
|
type: T;
|
|
778
792
|
target: DevicePair;
|
|
779
793
|
message: DevicePairEventMessages[T];
|
|
780
794
|
}) => void, options?: {
|
|
781
795
|
once?: boolean;
|
|
782
796
|
}) => void;
|
|
783
|
-
get removeEventListener(): <T extends "pressure" | "deviceOrientation" | "sensorData" | "isConnected" | "deviceConnected" | "deviceIsConnected" | "deviceMaxFileLength" | "deviceGetFileType" | "deviceGetFileLength" | "deviceGetFileChecksum" | "deviceFileTransferStatus" | "deviceGetFileBlock" | "deviceFileTransferProgress" | "deviceFileTransferComplete" | "deviceFileReceived" | "
|
|
797
|
+
get removeEventListener(): <T extends "pressure" | "deviceOrientation" | "sensorData" | "isConnected" | "deviceConnected" | "deviceIsConnected" | "devicePressure" | "deviceMaxFileLength" | "deviceGetFileType" | "deviceGetFileLength" | "deviceGetFileChecksum" | "deviceFileTransferStatus" | "deviceGetFileBlock" | "deviceFileTransferProgress" | "deviceFileTransferComplete" | "deviceFileReceived" | "deviceAcceleration" | "deviceGravity" | "deviceLinearAcceleration" | "deviceGyroscope" | "deviceMagnetometer" | "deviceGameRotation" | "deviceRotation" | "deviceActivity" | "deviceStepCounter" | "deviceStepDetector" | "deviceDeviceOrientation" | "deviceBarometer" | "deviceSensorData" | "deviceGetSensorConfiguration" | "deviceGetTfliteName" | "deviceGetTfliteTask" | "deviceGetTfliteSampleRate" | "deviceGetTfliteSensorTypes" | "deviceTfliteIsReady" | "deviceGetTfliteCaptureDelay" | "deviceGetTfliteThreshold" | "deviceGetTfliteInferencingEnabled" | "deviceTfliteInference" | "deviceManufacturerName" | "deviceModelNumber" | "deviceSoftwareRevision" | "deviceHardwareRevision" | "deviceFirmwareRevision" | "devicePnpId" | "deviceSerialNumber" | "deviceDeviceInformation" | "deviceIsCharging" | "deviceGetBatteryCurrent" | "deviceGetMtu" | "deviceGetId" | "deviceGetName" | "deviceGetType" | "deviceGetCurrentTime" | "deviceNotConnected" | "deviceConnecting" | "deviceDisconnecting" | "deviceConnectionStatus" | "deviceSmp" | "deviceBatteryLevel" | "deviceFirmwareImages" | "deviceFirmwareUploadProgress" | "deviceFirmwareStatus" | "deviceConnectionMessage">(type: T, listener: (event: {
|
|
784
798
|
type: T;
|
|
785
799
|
target: DevicePair;
|
|
786
800
|
message: DevicePairEventMessages[T];
|
|
787
801
|
}) => void) => void;
|
|
788
|
-
get waitForEvent(): <T extends "pressure" | "deviceOrientation" | "sensorData" | "isConnected" | "deviceConnected" | "deviceIsConnected" | "deviceMaxFileLength" | "deviceGetFileType" | "deviceGetFileLength" | "deviceGetFileChecksum" | "deviceFileTransferStatus" | "deviceGetFileBlock" | "deviceFileTransferProgress" | "deviceFileTransferComplete" | "deviceFileReceived" | "
|
|
802
|
+
get waitForEvent(): <T extends "pressure" | "deviceOrientation" | "sensorData" | "isConnected" | "deviceConnected" | "deviceIsConnected" | "devicePressure" | "deviceMaxFileLength" | "deviceGetFileType" | "deviceGetFileLength" | "deviceGetFileChecksum" | "deviceFileTransferStatus" | "deviceGetFileBlock" | "deviceFileTransferProgress" | "deviceFileTransferComplete" | "deviceFileReceived" | "deviceAcceleration" | "deviceGravity" | "deviceLinearAcceleration" | "deviceGyroscope" | "deviceMagnetometer" | "deviceGameRotation" | "deviceRotation" | "deviceActivity" | "deviceStepCounter" | "deviceStepDetector" | "deviceDeviceOrientation" | "deviceBarometer" | "deviceSensorData" | "deviceGetSensorConfiguration" | "deviceGetTfliteName" | "deviceGetTfliteTask" | "deviceGetTfliteSampleRate" | "deviceGetTfliteSensorTypes" | "deviceTfliteIsReady" | "deviceGetTfliteCaptureDelay" | "deviceGetTfliteThreshold" | "deviceGetTfliteInferencingEnabled" | "deviceTfliteInference" | "deviceManufacturerName" | "deviceModelNumber" | "deviceSoftwareRevision" | "deviceHardwareRevision" | "deviceFirmwareRevision" | "devicePnpId" | "deviceSerialNumber" | "deviceDeviceInformation" | "deviceIsCharging" | "deviceGetBatteryCurrent" | "deviceGetMtu" | "deviceGetId" | "deviceGetName" | "deviceGetType" | "deviceGetCurrentTime" | "deviceNotConnected" | "deviceConnecting" | "deviceDisconnecting" | "deviceConnectionStatus" | "deviceSmp" | "deviceBatteryLevel" | "deviceFirmwareImages" | "deviceFirmwareUploadProgress" | "deviceFirmwareStatus" | "deviceConnectionMessage">(type: T) => Promise<{
|
|
789
803
|
type: T;
|
|
790
804
|
target: DevicePair;
|
|
791
805
|
message: DevicePairEventMessages[T];
|
|
792
806
|
}>;
|
|
793
|
-
get removeEventListeners(): <T extends "pressure" | "deviceOrientation" | "sensorData" | "isConnected" | "deviceConnected" | "deviceIsConnected" | "deviceMaxFileLength" | "deviceGetFileType" | "deviceGetFileLength" | "deviceGetFileChecksum" | "deviceFileTransferStatus" | "deviceGetFileBlock" | "deviceFileTransferProgress" | "deviceFileTransferComplete" | "deviceFileReceived" | "
|
|
807
|
+
get removeEventListeners(): <T extends "pressure" | "deviceOrientation" | "sensorData" | "isConnected" | "deviceConnected" | "deviceIsConnected" | "devicePressure" | "deviceMaxFileLength" | "deviceGetFileType" | "deviceGetFileLength" | "deviceGetFileChecksum" | "deviceFileTransferStatus" | "deviceGetFileBlock" | "deviceFileTransferProgress" | "deviceFileTransferComplete" | "deviceFileReceived" | "deviceAcceleration" | "deviceGravity" | "deviceLinearAcceleration" | "deviceGyroscope" | "deviceMagnetometer" | "deviceGameRotation" | "deviceRotation" | "deviceActivity" | "deviceStepCounter" | "deviceStepDetector" | "deviceDeviceOrientation" | "deviceBarometer" | "deviceSensorData" | "deviceGetSensorConfiguration" | "deviceGetTfliteName" | "deviceGetTfliteTask" | "deviceGetTfliteSampleRate" | "deviceGetTfliteSensorTypes" | "deviceTfliteIsReady" | "deviceGetTfliteCaptureDelay" | "deviceGetTfliteThreshold" | "deviceGetTfliteInferencingEnabled" | "deviceTfliteInference" | "deviceManufacturerName" | "deviceModelNumber" | "deviceSoftwareRevision" | "deviceHardwareRevision" | "deviceFirmwareRevision" | "devicePnpId" | "deviceSerialNumber" | "deviceDeviceInformation" | "deviceIsCharging" | "deviceGetBatteryCurrent" | "deviceGetMtu" | "deviceGetId" | "deviceGetName" | "deviceGetType" | "deviceGetCurrentTime" | "deviceNotConnected" | "deviceConnecting" | "deviceDisconnecting" | "deviceConnectionStatus" | "deviceSmp" | "deviceBatteryLevel" | "deviceFirmwareImages" | "deviceFirmwareUploadProgress" | "deviceFirmwareStatus" | "deviceConnectionMessage">(type: T) => void;
|
|
794
808
|
get removeAllEventListeners(): () => void;
|
|
795
809
|
get left(): Device | undefined;
|
|
796
810
|
get right(): Device | undefined;
|
|
797
811
|
get isConnected(): boolean;
|
|
798
812
|
get isPartiallyConnected(): boolean;
|
|
799
813
|
get isHalfConnected(): boolean;
|
|
800
|
-
|
|
814
|
+
assignDevice(device: Device): Device | undefined;
|
|
801
815
|
setSensorConfiguration(sensorConfiguration: SensorConfiguration): Promise<void>;
|
|
802
816
|
resetPressureRange(): void;
|
|
803
817
|
triggerVibration(vibrationConfigurations: VibrationConfiguration[], sendImmediately?: boolean): Promise<PromiseSettledResult<void | undefined>[]>;
|
|
804
|
-
static get
|
|
818
|
+
static get insoles(): DevicePair;
|
|
819
|
+
static get gloves(): DevicePair;
|
|
805
820
|
}
|
|
806
821
|
|
|
807
822
|
interface DiscoveredDevice {
|
|
@@ -892,6 +907,7 @@ declare abstract class BaseClient {
|
|
|
892
907
|
protected get _connectionStatus(): "notConnected" | "connecting" | "connected" | "disconnecting";
|
|
893
908
|
protected set _connectionStatus(newConnectionStatus: "notConnected" | "connecting" | "connected" | "disconnecting");
|
|
894
909
|
get connectionStatus(): "notConnected" | "connecting" | "connected" | "disconnecting";
|
|
910
|
+
protected _sendRequiredMessages(): void;
|
|
895
911
|
protected parseMessage(dataView: DataView): void;
|
|
896
912
|
get isScanningAvailable(): boolean;
|
|
897
913
|
protected requestIsScanningAvailable(): void;
|
|
@@ -928,4 +944,4 @@ declare class WebSocketClient extends BaseClient {
|
|
|
928
944
|
sendServerMessage(...messages: ServerMessage[]): void;
|
|
929
945
|
}
|
|
930
946
|
|
|
931
|
-
export { type BoundDeviceEventListeners, type BoundDeviceManagerEventListeners, type BoundDevicePairEventListeners, type CenterOfPressure, type ContinuousSensorType, ContinuousSensorTypes, DefaultNumberOfPressureSensors, Device, type DeviceEvent, type DeviceEventListenerMap, type DeviceEventMap, type DeviceInformation, _default as DeviceManager, type DeviceManagerEvent, type DeviceManagerEventListenerMap, type DeviceManagerEventMap, DevicePair, type DevicePairEvent, type DevicePairEventListenerMap, type DevicePairEventMap, type DeviceType, DeviceTypes, type DiscoveredDevice, environment_d as Environment, type Euler, type FileTransferDirection, FileTransferDirections, type FileType, FileTypes,
|
|
947
|
+
export { type BoundDeviceEventListeners, type BoundDeviceManagerEventListeners, type BoundDevicePairEventListeners, type CenterOfPressure, type ContinuousSensorType, ContinuousSensorTypes, DefaultNumberOfPressureSensors, Device, type DeviceEvent, type DeviceEventListenerMap, type DeviceEventMap, type DeviceInformation, _default as DeviceManager, type DeviceManagerEvent, type DeviceManagerEventListenerMap, type DeviceManagerEventMap, DevicePair, type DevicePairEvent, type DevicePairEventListenerMap, type DevicePairEventMap, type DevicePairType, DevicePairTypes, type DeviceType, DeviceTypes, type DiscoveredDevice, environment_d as Environment, type Euler, type FileTransferDirection, FileTransferDirections, type FileType, FileTypes, MaxNameLength, MaxNumberOfVibrationWaveformEffectSegments, MaxNumberOfVibrationWaveformSegments, MaxSensorRate, MaxVibrationWaveformEffectSegmentDelay, MaxVibrationWaveformEffectSegmentLoopCount, MaxVibrationWaveformEffectSequenceLoopCount, MaxVibrationWaveformSegmentDuration, MinNameLength, type PressureData, type Quaternion, RangeHelper, type SensorConfiguration, SensorRateStep, type SensorType, SensorTypes, type Side, Sides, type TfliteSensorType, TfliteSensorTypes, type TfliteTask, TfliteTasks, type Vector2, type Vector3, type VibrationConfiguration, type VibrationLocation, VibrationLocations, type VibrationType, VibrationTypes, type VibrationWaveformEffect, VibrationWaveformEffects, WebSocketClient, setAllConsoleLevelFlags, setConsoleLevelFlagsForType };
|