brilliantsole 0.0.26 → 0.0.28
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/anchor.glb +0 -0
- package/assets/3d/coin.glb +0 -0
- package/assets/3d/glasses.glb +0 -0
- package/assets/3d/rightHand.glb +0 -0
- package/assets/audio/bounceMedium.wav +0 -0
- package/assets/audio/bounceStrong.wav +0 -0
- package/assets/audio/bounceWeak.wav +0 -0
- package/assets/audio/coin.wav +0 -0
- package/assets/audio/getUp.wav +0 -0
- package/assets/audio/grab.wav +0 -0
- package/assets/audio/kick.wav +0 -0
- package/assets/audio/platterFadeIn old.wav +0 -0
- package/assets/audio/platterFadeIn.wav +0 -0
- package/assets/audio/platterFadeOut.wav +0 -0
- package/assets/audio/punch.wav +0 -0
- package/assets/audio/punchSqueak.wav +0 -0
- package/assets/audio/purr.wav +0 -0
- package/assets/audio/purrFadeOut.wav +0 -0
- package/assets/audio/release.wav +0 -0
- package/assets/audio/splat.wav +0 -0
- package/assets/audio/stomp.wav +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 +2870 -882
- package/build/brilliantsole.cjs.map +1 -1
- package/build/brilliantsole.js +2477 -782
- package/build/brilliantsole.js.map +1 -1
- package/build/brilliantsole.ls.js +2260 -592
- 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 +302 -116
- package/build/brilliantsole.module.js +2468 -782
- package/build/brilliantsole.module.js.map +1 -1
- package/build/brilliantsole.module.min.d.ts +302 -116
- package/build/brilliantsole.module.min.js +1 -1
- package/build/brilliantsole.module.min.js.map +1 -1
- package/build/brilliantsole.node.module.d.ts +295 -113
- package/build/brilliantsole.node.module.js +2860 -882
- package/build/brilliantsole.node.module.js.map +1 -1
- package/build/dts/BS-output.d.ts +10 -0
- package/build/dts/BS.d.ts +21 -9
- package/build/dts/CameraManager.d.ts +72 -0
- package/build/dts/Device.d.ts +53 -16
- package/build/dts/DeviceInformationManager.d.ts +4 -4
- package/build/dts/DeviceManager.d.ts +3 -0
- package/build/dts/FileTransferManager.d.ts +18 -8
- package/build/dts/InformationManager.d.ts +8 -5
- package/build/dts/TfliteManager.d.ts +22 -2
- package/build/dts/WifiManager.d.ts +61 -0
- package/build/dts/connection/BaseConnectionManager.d.ts +37 -3
- package/build/dts/connection/ClientConnectionManager.d.ts +11 -2
- package/build/dts/connection/bluetooth/BluetoothConnectionManager.d.ts +1 -0
- package/build/dts/connection/bluetooth/NobleConnectionManager.d.ts +3 -1
- package/build/dts/connection/bluetooth/WebBluetoothConnectionManager.d.ts +2 -0
- package/build/dts/connection/bluetooth/bluetoothUUIDs.d.ts +2 -2
- package/build/dts/connection/udp/UDPConnectionManager.d.ts +28 -0
- package/build/dts/connection/webSocket/WebSocketConnectionManager.d.ts +25 -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/scanner/BaseScanner.d.ts +4 -1
- package/build/dts/scanner/NobleScanner.d.ts +2 -1
- package/build/dts/sensor/MotionSensorDataManager.d.ts +5 -2
- package/build/dts/sensor/SensorDataManager.d.ts +5 -4
- package/build/dts/server/BaseClient.d.ts +6 -3
- package/build/dts/server/ServerUtils.d.ts +1 -1
- package/build/dts/server/websocket/WebSocketUtils.d.ts +1 -1
- package/build/dts/utils/CenterOfPressureHelper.d.ts +2 -2
- package/build/dts/utils/Console.d.ts +2 -0
- package/build/dts/utils/MathUtils.d.ts +2 -0
- package/build/dts/utils/ThrottleUtils.d.ts +2 -0
- package/build/dts/vibration/VibrationManager.d.ts +19 -2
- package/build/index.d.ts +299 -113
- package/build/index.node.d.ts +292 -110
- package/examples/3d/scene.html +19 -5
- package/examples/3d/script.js +90 -17
- package/examples/3d-generic/index.html +144 -0
- package/examples/3d-generic/script.js +266 -0
- package/examples/balance/script.js +2 -1
- package/examples/basic/index.html +232 -18
- package/examples/basic/script.js +746 -106
- 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/edge-impulse/script.js +135 -44
- package/examples/edge-impulse-test/README.md +11 -0
- package/examples/edge-impulse-test/edge-impulse-standalone.js +7228 -0
- package/examples/edge-impulse-test/edge-impulse-standalone.wasm +0 -0
- package/examples/edge-impulse-test/index.html +75 -0
- package/examples/edge-impulse-test/run-impulse.js +135 -0
- package/examples/edge-impulse-test/script.js +200 -0
- package/examples/gloves/edge-impulse-standalone.js +7228 -0
- package/examples/gloves/edge-impulse-standalone.wasm +0 -0
- package/examples/gloves/index.html +119 -0
- package/examples/gloves/run-impulse.js +135 -0
- package/examples/gloves/scene.html +124 -0
- package/examples/gloves/script.js +931 -0
- package/examples/graph/index.html +11 -1
- package/examples/graph/script.js +94 -37
- package/examples/pressure/index.html +180 -12
- package/examples/pressure/script.js +144 -7
- package/examples/punch/index.html +135 -0
- package/examples/punch/punch.tflite +0 -0
- package/examples/punch/script.js +169 -0
- package/examples/recording/index.html +191 -183
- package/examples/server/index.html +109 -23
- package/examples/server/script.js +322 -111
- 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/utils/aframe/aframe-master.min.js +2 -0
- package/examples/utils/aframe/bs-vibration.js +150 -0
- package/examples/utils/aframe/force-pushable.js +80 -0
- package/examples/utils/aframe/grabbable-anchor.js +46 -0
- package/examples/utils/aframe/grabbable-listener.js +31 -0
- package/examples/utils/aframe/grabbable-physics-body.js +190 -0
- package/examples/utils/aframe/grow-shrink.js +25 -0
- package/examples/utils/aframe/hand-punch.js +119 -0
- package/examples/utils/aframe/my-obb-collider.js +293 -0
- package/examples/utils/aframe/occlude-hand-tracking-controls.js +47 -0
- package/examples/utils/aframe/occlude-mesh.js +42 -0
- package/examples/utils/aframe/palm-up-detector.js +47 -0
- package/examples/utils/aframe/shadow-material.js +20 -0
- package/examples/utils/aframe/soft-shadow-light.js +9 -0
- package/examples/webxr/script.js +3 -3
- package/examples/webxr-2/assets/3d/soccerBall.glb +0 -0
- package/examples/webxr-2/assets/audio/shellBounce.wav +0 -0
- package/examples/webxr-2/assets/audio/shellHit.wav +0 -0
- package/examples/webxr-2/assets/audio/shellKick.wav +0 -0
- package/examples/webxr-2/assets/audio/soccerBounce.wav +0 -0
- package/examples/webxr-2/assets/audio/soccerKick.mp3 +0 -0
- package/examples/webxr-2/assets/images/shellTexture.png +0 -0
- package/examples/webxr-2/components/bs-ankle.js +337 -0
- package/examples/webxr-2/components/coin.js +84 -0
- package/examples/webxr-2/components/custom-wrap.js +17 -0
- package/examples/webxr-2/components/goomba.js +3250 -0
- package/examples/webxr-2/components/init-shell-material.js +215 -0
- package/examples/webxr-2/components/platter.js +172 -0
- package/examples/webxr-2/components/shell.js +374 -0
- package/examples/webxr-2/components/soccer-ball.js +250 -0
- package/examples/webxr-2/components/squashed-goomba.js +249 -0
- package/examples/webxr-2/edge-impulse-standalone.js +7228 -0
- package/examples/webxr-2/edge-impulse-standalone.wasm +0 -0
- package/examples/webxr-2/index.html +996 -0
- package/examples/webxr-2/kick.tflite +0 -0
- package/examples/webxr-2/kick2.tflite +0 -0
- package/examples/webxr-2/run-impulse.js +135 -0
- package/examples/webxr-2/script.js +384 -0
- package/package.json +2 -1
- package/src/.prettierrc +4 -0
- package/src/BS.ts +66 -9
- package/src/CameraManager.ts +499 -0
- package/src/Device.ts +620 -92
- package/src/DeviceInformationManager.ts +22 -11
- package/src/DeviceManager.ts +94 -25
- package/src/FileTransferManager.ts +146 -21
- package/src/FirmwareManager.ts +1 -1
- package/src/InformationManager.ts +62 -20
- package/src/TfliteManager.ts +172 -26
- package/src/WifiManager.ts +323 -0
- package/src/connection/BaseConnectionManager.ts +145 -30
- package/src/connection/ClientConnectionManager.ts +47 -11
- package/src/connection/bluetooth/BluetoothConnectionManager.ts +14 -3
- package/src/connection/bluetooth/NobleConnectionManager.ts +155 -42
- package/src/connection/bluetooth/WebBluetoothConnectionManager.ts +104 -35
- package/src/connection/bluetooth/bluetoothUUIDs.ts +40 -13
- package/src/connection/udp/UDPConnectionManager.ts +356 -0
- package/src/connection/websocket/WebSocketConnectionManager.ts +282 -0
- package/src/devicePair/DevicePair.ts +145 -49
- package/src/devicePair/DevicePairPressureSensorDataManager.ts +72 -24
- package/src/devicePair/DevicePairSensorDataManager.ts +5 -5
- package/src/scanner/BaseScanner.ts +49 -11
- package/src/scanner/NobleScanner.ts +81 -17
- package/src/sensor/BarometerSensorDataManager.ts +1 -1
- package/src/sensor/MotionSensorDataManager.ts +22 -7
- package/src/sensor/PressureSensorDataManager.ts +47 -13
- package/src/sensor/SensorConfigurationManager.ts +75 -24
- package/src/sensor/SensorDataManager.ts +107 -26
- package/src/server/BaseClient.ts +192 -37
- package/src/server/BaseServer.ts +201 -43
- package/src/server/ServerUtils.ts +39 -9
- package/src/server/udp/UDPServer.ts +74 -23
- package/src/server/udp/UDPUtils.ts +9 -2
- package/src/server/websocket/WebSocketClient.ts +30 -9
- package/src/server/websocket/WebSocketServer.ts +1 -1
- package/src/server/websocket/WebSocketUtils.ts +4 -2
- package/src/utils/CenterOfPressureHelper.ts +5 -5
- package/src/utils/Console.ts +62 -9
- package/src/utils/MathUtils.ts +31 -1
- package/src/utils/ParseUtils.ts +25 -6
- package/src/utils/ThrottleUtils.ts +62 -0
- package/src/utils/Timer.ts +1 -1
- package/src/utils/checksum.ts +1 -1
- package/src/utils/mcumgr.js +1 -1
- package/src/vibration/VibrationManager.ts +166 -40
package/build/index.node.d.ts
CHANGED
|
@@ -41,6 +41,43 @@ declare namespace environment_d {
|
|
|
41
41
|
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 };
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
declare class RangeHelper {
|
|
45
|
+
#private;
|
|
46
|
+
get min(): number;
|
|
47
|
+
get max(): number;
|
|
48
|
+
set min(newMin: number);
|
|
49
|
+
set max(newMax: number);
|
|
50
|
+
reset(): void;
|
|
51
|
+
update(value: number): void;
|
|
52
|
+
getNormalization(value: number, weightByRange: boolean): number;
|
|
53
|
+
updateAndGetNormalization(value: number, weightByRange: boolean): number;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
type CenterOfPressure = Vector2;
|
|
57
|
+
|
|
58
|
+
type PressureSensorPosition = Vector2;
|
|
59
|
+
|
|
60
|
+
interface PressureSensorValue {
|
|
61
|
+
position: PressureSensorPosition;
|
|
62
|
+
rawValue: number;
|
|
63
|
+
scaledValue: number;
|
|
64
|
+
normalizedValue: number;
|
|
65
|
+
weightedValue: number;
|
|
66
|
+
}
|
|
67
|
+
interface PressureData {
|
|
68
|
+
sensors: PressureSensorValue[];
|
|
69
|
+
scaledSum: number;
|
|
70
|
+
normalizedSum: number;
|
|
71
|
+
center?: CenterOfPressure;
|
|
72
|
+
normalizedCenter?: CenterOfPressure;
|
|
73
|
+
}
|
|
74
|
+
interface PressureDataEventMessages {
|
|
75
|
+
pressure: {
|
|
76
|
+
pressure: PressureData;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
declare const DefaultNumberOfPressureSensors = 8;
|
|
80
|
+
|
|
44
81
|
interface Vector2 {
|
|
45
82
|
x: number;
|
|
46
83
|
y: number;
|
|
@@ -112,6 +149,41 @@ declare class EventDispatcher<Target extends any, EventType extends string, Even
|
|
|
112
149
|
}>;
|
|
113
150
|
}
|
|
114
151
|
|
|
152
|
+
declare const CameraCommands: readonly ["focus", "takePicture", "stop", "sleep", "wake"];
|
|
153
|
+
type CameraCommand = (typeof CameraCommands)[number];
|
|
154
|
+
declare const CameraStatuses: readonly ["idle", "focusing", "takingPicture", "asleep"];
|
|
155
|
+
type CameraStatus = (typeof CameraStatuses)[number];
|
|
156
|
+
declare const CameraDataTypes: readonly ["headerSize", "header", "imageSize", "image", "footerSize", "footer"];
|
|
157
|
+
type CameraDataType = (typeof CameraDataTypes)[number];
|
|
158
|
+
declare const CameraConfigurationTypes: readonly ["resolution", "qualityFactor", "shutter", "gain", "redGain", "greenGain", "blueGain"];
|
|
159
|
+
type CameraConfigurationType = (typeof CameraConfigurationTypes)[number];
|
|
160
|
+
type CameraConfiguration = {
|
|
161
|
+
[cameraConfigurationType in CameraConfigurationType]?: number;
|
|
162
|
+
};
|
|
163
|
+
type CameraConfigurationRanges = {
|
|
164
|
+
[cameraConfigurationType in CameraConfigurationType]: {
|
|
165
|
+
min: number;
|
|
166
|
+
max: number;
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
interface CameraEventMessages {
|
|
170
|
+
cameraStatus: {
|
|
171
|
+
cameraStatus: CameraStatus;
|
|
172
|
+
previousCameraStatus: CameraStatus;
|
|
173
|
+
};
|
|
174
|
+
getCameraConfiguration: {
|
|
175
|
+
cameraConfiguration: CameraConfiguration;
|
|
176
|
+
};
|
|
177
|
+
cameraImageProgress: {
|
|
178
|
+
progress: number;
|
|
179
|
+
type: CameraDataType;
|
|
180
|
+
};
|
|
181
|
+
cameraImage: {
|
|
182
|
+
blob: Blob;
|
|
183
|
+
url: string;
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
|
|
115
187
|
type FileLike = number[] | ArrayBuffer | DataView | URL | string | File;
|
|
116
188
|
|
|
117
189
|
declare const FirmwareStatuses: readonly ["idle", "uploading", "uploaded", "pending", "testing", "erasing"];
|
|
@@ -142,43 +214,6 @@ interface FirmwareEventMessages {
|
|
|
142
214
|
};
|
|
143
215
|
}
|
|
144
216
|
|
|
145
|
-
declare class RangeHelper {
|
|
146
|
-
#private;
|
|
147
|
-
get min(): number;
|
|
148
|
-
get max(): number;
|
|
149
|
-
set min(newMin: number);
|
|
150
|
-
set max(newMax: number);
|
|
151
|
-
reset(): void;
|
|
152
|
-
update(value: number): void;
|
|
153
|
-
getNormalization(value: number, weightByRange: boolean): number;
|
|
154
|
-
updateAndGetNormalization(value: number, weightByRange: boolean): number;
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
type CenterOfPressure = Vector2;
|
|
158
|
-
|
|
159
|
-
type PressureSensorPosition = Vector2;
|
|
160
|
-
|
|
161
|
-
interface PressureSensorValue {
|
|
162
|
-
position: PressureSensorPosition;
|
|
163
|
-
rawValue: number;
|
|
164
|
-
scaledValue: number;
|
|
165
|
-
normalizedValue: number;
|
|
166
|
-
weightedValue: number;
|
|
167
|
-
}
|
|
168
|
-
interface PressureData {
|
|
169
|
-
sensors: PressureSensorValue[];
|
|
170
|
-
scaledSum: number;
|
|
171
|
-
normalizedSum: number;
|
|
172
|
-
center?: CenterOfPressure;
|
|
173
|
-
normalizedCenter?: CenterOfPressure;
|
|
174
|
-
}
|
|
175
|
-
interface PressureDataEventMessages {
|
|
176
|
-
pressure: {
|
|
177
|
-
pressure: PressureData;
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
declare const DefaultNumberOfPressureSensors = 8;
|
|
181
|
-
|
|
182
217
|
type ValueOf<T> = T[keyof T];
|
|
183
218
|
type AddProperty<T, Key extends string, Value> = T & {
|
|
184
219
|
[K in Key]: Value;
|
|
@@ -242,6 +277,9 @@ interface MotionSensorDataEventMessages {
|
|
|
242
277
|
deviceOrientation: {
|
|
243
278
|
deviceOrientation: DeviceOrientation;
|
|
244
279
|
};
|
|
280
|
+
tapDetector: {
|
|
281
|
+
tapDetector: Object;
|
|
282
|
+
};
|
|
245
283
|
}
|
|
246
284
|
|
|
247
285
|
interface BarometerSensorDataEventMessages {
|
|
@@ -250,9 +288,9 @@ interface BarometerSensorDataEventMessages {
|
|
|
250
288
|
};
|
|
251
289
|
}
|
|
252
290
|
|
|
253
|
-
declare const SensorTypes: readonly ["pressure", "acceleration", "gravity", "linearAcceleration", "gyroscope", "magnetometer", "gameRotation", "rotation", "orientation", "activity", "stepCounter", "stepDetector", "deviceOrientation", "barometer"];
|
|
291
|
+
declare const SensorTypes: readonly ["pressure", "acceleration", "gravity", "linearAcceleration", "gyroscope", "magnetometer", "gameRotation", "rotation", "orientation", "activity", "stepCounter", "stepDetector", "deviceOrientation", "tapDetector", "barometer", "camera"];
|
|
254
292
|
type SensorType = (typeof SensorTypes)[number];
|
|
255
|
-
declare const ContinuousSensorTypes: readonly ["pressure", "acceleration", "gravity", "linearAcceleration", "gyroscope", "magnetometer", "gameRotation", "rotation", "barometer"];
|
|
293
|
+
declare const ContinuousSensorTypes: readonly ["pressure", "acceleration", "gravity", "linearAcceleration", "gyroscope", "magnetometer", "gameRotation", "rotation", "orientation", "barometer"];
|
|
256
294
|
type ContinuousSensorType = (typeof ContinuousSensorTypes)[number];
|
|
257
295
|
interface BaseSensorDataEventMessage {
|
|
258
296
|
timestamp: number;
|
|
@@ -265,6 +303,49 @@ interface AnySensorDataEventMessages {
|
|
|
265
303
|
}
|
|
266
304
|
type SensorDataEventMessages = _SensorDataEventMessages & AnySensorDataEventMessages;
|
|
267
305
|
|
|
306
|
+
declare const FileTypes: readonly ["tflite", "wifiServerCert", "wifiServerKey"];
|
|
307
|
+
type FileType = (typeof FileTypes)[number];
|
|
308
|
+
declare const FileTransferStatuses: readonly ["idle", "sending", "receiving"];
|
|
309
|
+
type FileTransferStatus = (typeof FileTransferStatuses)[number];
|
|
310
|
+
declare const FileTransferDirections: readonly ["sending", "receiving"];
|
|
311
|
+
type FileTransferDirection = (typeof FileTransferDirections)[number];
|
|
312
|
+
interface FileConfiguration {
|
|
313
|
+
file: FileLike;
|
|
314
|
+
type: FileType;
|
|
315
|
+
}
|
|
316
|
+
interface FileTransferEventMessages {
|
|
317
|
+
getFileTypes: {
|
|
318
|
+
fileTypes: FileType[];
|
|
319
|
+
};
|
|
320
|
+
maxFileLength: {
|
|
321
|
+
maxFileLength: number;
|
|
322
|
+
};
|
|
323
|
+
getFileType: {
|
|
324
|
+
fileType: FileType;
|
|
325
|
+
};
|
|
326
|
+
getFileLength: {
|
|
327
|
+
fileLength: number;
|
|
328
|
+
};
|
|
329
|
+
getFileChecksum: {
|
|
330
|
+
fileChecksum: number;
|
|
331
|
+
};
|
|
332
|
+
fileTransferStatus: {
|
|
333
|
+
fileTransferStatus: FileTransferStatus;
|
|
334
|
+
};
|
|
335
|
+
getFileBlock: {
|
|
336
|
+
fileTransferBlock: DataView;
|
|
337
|
+
};
|
|
338
|
+
fileTransferProgress: {
|
|
339
|
+
progress: number;
|
|
340
|
+
};
|
|
341
|
+
fileTransferComplete: {
|
|
342
|
+
direction: FileTransferDirection;
|
|
343
|
+
};
|
|
344
|
+
fileReceived: {
|
|
345
|
+
file: File | Blob;
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
|
|
268
349
|
declare const TfliteTasks: readonly ["classification", "regression"];
|
|
269
350
|
type TfliteTask = (typeof TfliteTasks)[number];
|
|
270
351
|
interface TfliteEventMessages {
|
|
@@ -301,9 +382,23 @@ interface TfliteInference {
|
|
|
301
382
|
values: number[];
|
|
302
383
|
maxValue?: number;
|
|
303
384
|
maxIndex?: number;
|
|
385
|
+
maxClass?: string;
|
|
386
|
+
classValues?: {
|
|
387
|
+
[key: string]: number;
|
|
388
|
+
};
|
|
304
389
|
}
|
|
305
|
-
declare const TfliteSensorTypes:
|
|
390
|
+
declare const TfliteSensorTypes: readonly ["pressure", "linearAcceleration", "gyroscope", "magnetometer"];
|
|
306
391
|
type TfliteSensorType = (typeof TfliteSensorTypes)[number];
|
|
392
|
+
interface TfliteFileConfiguration extends FileConfiguration {
|
|
393
|
+
type: "tflite";
|
|
394
|
+
name: string;
|
|
395
|
+
sensorTypes: TfliteSensorType[];
|
|
396
|
+
task: TfliteTask;
|
|
397
|
+
sampleRate: number;
|
|
398
|
+
captureDelay?: number;
|
|
399
|
+
threshold?: number;
|
|
400
|
+
classes?: string[];
|
|
401
|
+
}
|
|
307
402
|
|
|
308
403
|
interface PnpId {
|
|
309
404
|
source: "Bluetooth" | "USB";
|
|
@@ -347,8 +442,30 @@ interface DeviceInformationEventMessages {
|
|
|
347
442
|
};
|
|
348
443
|
}
|
|
349
444
|
|
|
350
|
-
declare const ConnectionTypes: readonly ["webBluetooth", "noble", "client"];
|
|
445
|
+
declare const ConnectionTypes: readonly ["webBluetooth", "noble", "client", "webSocket", "udp"];
|
|
351
446
|
type ConnectionType = (typeof ConnectionTypes)[number];
|
|
447
|
+
interface BaseConnectOptions {
|
|
448
|
+
type: "client" | "webBluetooth" | "webSocket" | "udp";
|
|
449
|
+
}
|
|
450
|
+
interface WebBluetoothConnectOptions extends BaseConnectOptions {
|
|
451
|
+
type: "webBluetooth";
|
|
452
|
+
}
|
|
453
|
+
interface BaseWifiConnectOptions extends BaseConnectOptions {
|
|
454
|
+
ipAddress: string;
|
|
455
|
+
}
|
|
456
|
+
interface ClientConnectOptions extends BaseConnectOptions {
|
|
457
|
+
type: "client";
|
|
458
|
+
subType?: "noble" | "webSocket" | "udp";
|
|
459
|
+
}
|
|
460
|
+
interface WebSocketConnectOptions extends BaseWifiConnectOptions {
|
|
461
|
+
type: "webSocket";
|
|
462
|
+
isWifiSecure?: boolean;
|
|
463
|
+
}
|
|
464
|
+
interface UDPConnectOptions extends BaseWifiConnectOptions {
|
|
465
|
+
type: "udp";
|
|
466
|
+
receivePort?: number;
|
|
467
|
+
}
|
|
468
|
+
type ConnectOptions = WebBluetoothConnectOptions | WebSocketConnectOptions | UDPConnectOptions | ClientConnectOptions;
|
|
352
469
|
declare const ConnectionStatuses: readonly ["notConnected", "connecting", "connected", "disconnecting"];
|
|
353
470
|
type ConnectionStatus = (typeof ConnectionStatuses)[number];
|
|
354
471
|
interface ConnectionStatusEventMessages {
|
|
@@ -367,9 +484,9 @@ interface TxMessage {
|
|
|
367
484
|
type: TxRxMessageType;
|
|
368
485
|
data?: ArrayBuffer;
|
|
369
486
|
}
|
|
370
|
-
declare const TxRxMessageTypes: readonly ["isCharging", "getBatteryCurrent", "getMtu", "getId", "getName", "setName", "getType", "setType", "getCurrentTime", "setCurrentTime", "getSensorConfiguration", "setSensorConfiguration", "getPressurePositions", "getSensorScalars", "sensorData", "triggerVibration", "getTfliteName", "setTfliteName", "getTfliteTask", "setTfliteTask", "getTfliteSampleRate", "setTfliteSampleRate", "getTfliteSensorTypes", "setTfliteSensorTypes", "tfliteIsReady", "getTfliteCaptureDelay", "setTfliteCaptureDelay", "getTfliteThreshold", "setTfliteThreshold", "getTfliteInferencingEnabled", "setTfliteInferencingEnabled", "tfliteInference", "
|
|
487
|
+
declare const TxRxMessageTypes: readonly ["isCharging", "getBatteryCurrent", "getMtu", "getId", "getName", "setName", "getType", "setType", "getCurrentTime", "setCurrentTime", "getSensorConfiguration", "setSensorConfiguration", "getPressurePositions", "getSensorScalars", "sensorData", "getVibrationLocations", "triggerVibration", "getFileTypes", "maxFileLength", "getFileType", "setFileType", "getFileLength", "setFileLength", "getFileChecksum", "setFileChecksum", "setFileTransferCommand", "fileTransferStatus", "getFileBlock", "setFileBlock", "fileBytesTransferred", "getTfliteName", "setTfliteName", "getTfliteTask", "setTfliteTask", "getTfliteSampleRate", "setTfliteSampleRate", "getTfliteSensorTypes", "setTfliteSensorTypes", "tfliteIsReady", "getTfliteCaptureDelay", "setTfliteCaptureDelay", "getTfliteThreshold", "setTfliteThreshold", "getTfliteInferencingEnabled", "setTfliteInferencingEnabled", "tfliteInference", "isWifiAvailable", "getWifiSSID", "setWifiSSID", "getWifiPassword", "setWifiPassword", "getWifiConnectionEnabled", "setWifiConnectionEnabled", "isWifiConnected", "ipAddress", "isWifiSecure", "cameraStatus", "cameraCommand", "getCameraConfiguration", "setCameraConfiguration", "cameraData"];
|
|
371
488
|
type TxRxMessageType = (typeof TxRxMessageTypes)[number];
|
|
372
|
-
declare const ConnectionMessageTypes: readonly ["batteryLevel", "manufacturerName", "modelNumber", "
|
|
489
|
+
declare const ConnectionMessageTypes: readonly ["batteryLevel", "manufacturerName", "modelNumber", "hardwareRevision", "firmwareRevision", "softwareRevision", "pnpId", "serialNumber", "rx", "tx", "isCharging", "getBatteryCurrent", "getMtu", "getId", "getName", "setName", "getType", "setType", "getCurrentTime", "setCurrentTime", "getSensorConfiguration", "setSensorConfiguration", "getPressurePositions", "getSensorScalars", "sensorData", "getVibrationLocations", "triggerVibration", "getFileTypes", "maxFileLength", "getFileType", "setFileType", "getFileLength", "setFileLength", "getFileChecksum", "setFileChecksum", "setFileTransferCommand", "fileTransferStatus", "getFileBlock", "setFileBlock", "fileBytesTransferred", "getTfliteName", "setTfliteName", "getTfliteTask", "setTfliteTask", "getTfliteSampleRate", "setTfliteSampleRate", "getTfliteSensorTypes", "setTfliteSensorTypes", "tfliteIsReady", "getTfliteCaptureDelay", "setTfliteCaptureDelay", "getTfliteThreshold", "setTfliteThreshold", "getTfliteInferencingEnabled", "setTfliteInferencingEnabled", "tfliteInference", "isWifiAvailable", "getWifiSSID", "setWifiSSID", "getWifiPassword", "setWifiPassword", "getWifiConnectionEnabled", "setWifiConnectionEnabled", "isWifiConnected", "ipAddress", "isWifiSecure", "cameraStatus", "cameraCommand", "getCameraConfiguration", "setCameraConfiguration", "cameraData", "smp"];
|
|
373
490
|
type ConnectionMessageType = (typeof ConnectionMessageTypes)[number];
|
|
374
491
|
type ConnectionStatusCallback = (status: ConnectionStatus) => void;
|
|
375
492
|
type MessageReceivedCallback = (messageType: ConnectionMessageType, dataView: DataView) => void;
|
|
@@ -383,22 +500,32 @@ declare abstract class BaseConnectionManager {
|
|
|
383
500
|
protected get baseConstructor(): typeof BaseConnectionManager;
|
|
384
501
|
static get isSupported(): boolean;
|
|
385
502
|
get isSupported(): boolean;
|
|
503
|
+
get canUpdateFirmware(): boolean;
|
|
386
504
|
static type: ConnectionType;
|
|
387
505
|
get type(): ConnectionType;
|
|
388
506
|
constructor();
|
|
389
507
|
get status(): "notConnected" | "connecting" | "connected" | "disconnecting";
|
|
390
508
|
protected set status(newConnectionStatus: "notConnected" | "connecting" | "connected" | "disconnecting");
|
|
391
509
|
get isConnected(): boolean;
|
|
510
|
+
get isAvailable(): boolean;
|
|
511
|
+
/** @throws {Error} if connected */
|
|
512
|
+
protected assertIsNotConnected(): void;
|
|
513
|
+
/** @throws {Error} if not connected */
|
|
514
|
+
protected assertIsConnected(): void;
|
|
515
|
+
/** @throws {Error} if not connected or is disconnecting */
|
|
516
|
+
assertIsConnectedAndNotDisconnecting(): void;
|
|
392
517
|
connect(): Promise<void>;
|
|
393
518
|
get canReconnect(): boolean;
|
|
394
519
|
reconnect(): Promise<void>;
|
|
395
520
|
disconnect(): Promise<void>;
|
|
396
521
|
sendSmpMessage(data: ArrayBuffer): Promise<void>;
|
|
397
522
|
sendTxMessages(messages: TxMessage[] | undefined, sendImmediately?: boolean): Promise<void>;
|
|
523
|
+
protected defaultMtu: number;
|
|
398
524
|
mtu?: number;
|
|
399
525
|
sendTxData(data: ArrayBuffer): Promise<void>;
|
|
400
526
|
parseRxMessage(dataView: DataView): void;
|
|
401
527
|
clear(): void;
|
|
528
|
+
remove(): void;
|
|
402
529
|
}
|
|
403
530
|
|
|
404
531
|
type SensorConfiguration = {
|
|
@@ -449,46 +576,10 @@ interface VibrationWaveformConfiguration extends BaseVibrationConfiguration {
|
|
|
449
576
|
}
|
|
450
577
|
type VibrationConfiguration = VibrationWaveformEffectConfiguration | VibrationWaveformConfiguration;
|
|
451
578
|
|
|
452
|
-
declare const
|
|
453
|
-
type FileType = (typeof FileTypes)[number];
|
|
454
|
-
declare const FileTransferStatuses: readonly ["idle", "sending", "receiving"];
|
|
455
|
-
type FileTransferStatus = (typeof FileTransferStatuses)[number];
|
|
456
|
-
declare const FileTransferDirections: readonly ["sending", "receiving"];
|
|
457
|
-
type FileTransferDirection = (typeof FileTransferDirections)[number];
|
|
458
|
-
interface FileTransferEventMessages {
|
|
459
|
-
maxFileLength: {
|
|
460
|
-
maxFileLength: number;
|
|
461
|
-
};
|
|
462
|
-
getFileType: {
|
|
463
|
-
fileType: FileType;
|
|
464
|
-
};
|
|
465
|
-
getFileLength: {
|
|
466
|
-
fileLength: number;
|
|
467
|
-
};
|
|
468
|
-
getFileChecksum: {
|
|
469
|
-
fileChecksum: number;
|
|
470
|
-
};
|
|
471
|
-
fileTransferStatus: {
|
|
472
|
-
fileTransferStatus: FileTransferStatus;
|
|
473
|
-
};
|
|
474
|
-
getFileBlock: {
|
|
475
|
-
fileTransferBlock: DataView;
|
|
476
|
-
};
|
|
477
|
-
fileTransferProgress: {
|
|
478
|
-
progress: number;
|
|
479
|
-
};
|
|
480
|
-
fileTransferComplete: {
|
|
481
|
-
direction: FileTransferDirection;
|
|
482
|
-
};
|
|
483
|
-
fileReceived: {
|
|
484
|
-
file: File | Blob;
|
|
485
|
-
};
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
declare const DeviceTypes: readonly ["leftInsole", "rightInsole"];
|
|
579
|
+
declare const DeviceTypes: readonly ["leftInsole", "rightInsole", "leftGlove", "rightGlove", "glasses", "generic"];
|
|
489
580
|
type DeviceType = (typeof DeviceTypes)[number];
|
|
490
|
-
declare const
|
|
491
|
-
type
|
|
581
|
+
declare const Sides: readonly ["left", "right"];
|
|
582
|
+
type Side = (typeof Sides)[number];
|
|
492
583
|
declare const MinNameLength = 2;
|
|
493
584
|
declare const MaxNameLength = 30;
|
|
494
585
|
declare const InformationMessageTypes: readonly ["isCharging", "getBatteryCurrent", "getMtu", "getId", "getName", "setName", "getType", "setType", "getCurrentTime", "setCurrentTime"];
|
|
@@ -537,21 +628,48 @@ declare class InformationManager {
|
|
|
537
628
|
get name(): string;
|
|
538
629
|
updateName(updatedName: string): void;
|
|
539
630
|
setName(newName: string): Promise<void>;
|
|
540
|
-
get type(): "leftInsole" | "rightInsole";
|
|
631
|
+
get type(): "leftInsole" | "rightInsole" | "leftGlove" | "rightGlove" | "glasses" | "generic";
|
|
541
632
|
get typeEnum(): number;
|
|
542
633
|
updateType(updatedType: DeviceType): void;
|
|
543
634
|
setType(newType: DeviceType): Promise<void>;
|
|
544
635
|
get isInsole(): boolean;
|
|
545
|
-
get
|
|
636
|
+
get isGlove(): boolean;
|
|
637
|
+
get side(): Side;
|
|
546
638
|
get mtu(): number;
|
|
547
639
|
get isCurrentTimeSet(): boolean;
|
|
548
640
|
parseMessage(messageType: InformationMessageType, dataView: DataView): void;
|
|
549
641
|
clear(): void;
|
|
642
|
+
connectionType?: ConnectionType;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
declare const MinWifiSSIDLength = 1;
|
|
646
|
+
declare const MaxWifiSSIDLength = 32;
|
|
647
|
+
declare const MinWifiPasswordLength = 8;
|
|
648
|
+
declare const MaxWifiPasswordLength = 64;
|
|
649
|
+
interface WifiEventMessages {
|
|
650
|
+
isWifiAvailable: {
|
|
651
|
+
isWifiAvailable: boolean;
|
|
652
|
+
};
|
|
653
|
+
getWifiSSID: {
|
|
654
|
+
wifiSSID: string;
|
|
655
|
+
};
|
|
656
|
+
getWifiPassword: {
|
|
657
|
+
wifiPassword: string;
|
|
658
|
+
};
|
|
659
|
+
getEnableWifiConnection: {
|
|
660
|
+
wifiConnectionEnabled: boolean;
|
|
661
|
+
};
|
|
662
|
+
isWifiConnected: {
|
|
663
|
+
isWifiConnected: boolean;
|
|
664
|
+
};
|
|
665
|
+
ipAddress: {
|
|
666
|
+
ipAddress?: string;
|
|
667
|
+
};
|
|
550
668
|
}
|
|
551
669
|
|
|
552
|
-
declare const DeviceEventTypes: readonly ["connectionMessage", "notConnected", "connecting", "connected", "disconnecting", "connectionStatus", "isConnected", "rx", "tx", "batteryLevel", "isCharging", "getBatteryCurrent", "getMtu", "getId", "getName", "setName", "getType", "setType", "getCurrentTime", "setCurrentTime", "manufacturerName", "modelNumber", "
|
|
670
|
+
declare const DeviceEventTypes: readonly ["connectionMessage", "notConnected", "connecting", "connected", "disconnecting", "connectionStatus", "isConnected", "rx", "tx", "batteryLevel", "isCharging", "getBatteryCurrent", "getMtu", "getId", "getName", "setName", "getType", "setType", "getCurrentTime", "setCurrentTime", "manufacturerName", "modelNumber", "hardwareRevision", "firmwareRevision", "softwareRevision", "pnpId", "serialNumber", "deviceInformation", "getSensorConfiguration", "setSensorConfiguration", "getPressurePositions", "getSensorScalars", "sensorData", "pressure", "acceleration", "gravity", "linearAcceleration", "gyroscope", "magnetometer", "gameRotation", "rotation", "orientation", "activity", "stepCounter", "stepDetector", "deviceOrientation", "tapDetector", "barometer", "camera", "getVibrationLocations", "triggerVibration", "getFileTypes", "maxFileLength", "getFileType", "setFileType", "getFileLength", "setFileLength", "getFileChecksum", "setFileChecksum", "setFileTransferCommand", "fileTransferStatus", "getFileBlock", "setFileBlock", "fileBytesTransferred", "fileTransferProgress", "fileTransferComplete", "fileReceived", "getTfliteName", "setTfliteName", "getTfliteTask", "setTfliteTask", "getTfliteSampleRate", "setTfliteSampleRate", "getTfliteSensorTypes", "setTfliteSensorTypes", "tfliteIsReady", "getTfliteCaptureDelay", "setTfliteCaptureDelay", "getTfliteThreshold", "setTfliteThreshold", "getTfliteInferencingEnabled", "setTfliteInferencingEnabled", "tfliteInference", "isWifiAvailable", "getWifiSSID", "setWifiSSID", "getWifiPassword", "setWifiPassword", "getWifiConnectionEnabled", "setWifiConnectionEnabled", "isWifiConnected", "ipAddress", "isWifiSecure", "cameraStatus", "cameraCommand", "getCameraConfiguration", "setCameraConfiguration", "cameraData", "cameraImageProgress", "cameraImage", "smp", "firmwareImages", "firmwareUploadProgress", "firmwareStatus", "firmwareUploadComplete"];
|
|
553
671
|
type DeviceEventType = (typeof DeviceEventTypes)[number];
|
|
554
|
-
interface DeviceEventMessages extends ConnectionStatusEventMessages, DeviceInformationEventMessages, InformationEventMessages, SensorDataEventMessages, SensorConfigurationEventMessages, TfliteEventMessages, FileTransferEventMessages, FirmwareEventMessages {
|
|
672
|
+
interface DeviceEventMessages extends ConnectionStatusEventMessages, DeviceInformationEventMessages, InformationEventMessages, SensorDataEventMessages, SensorConfigurationEventMessages, TfliteEventMessages, FileTransferEventMessages, WifiEventMessages, CameraEventMessages, FirmwareEventMessages {
|
|
555
673
|
batteryLevel: {
|
|
556
674
|
batteryLevel: number;
|
|
557
675
|
};
|
|
@@ -571,30 +689,31 @@ type BoundDeviceEventListeners = BoundEventListeners<Device, DeviceEventType, De
|
|
|
571
689
|
declare class Device {
|
|
572
690
|
#private;
|
|
573
691
|
get bluetoothId(): string | undefined;
|
|
692
|
+
get isAvailable(): boolean | undefined;
|
|
574
693
|
constructor();
|
|
575
|
-
get addEventListener(): <T extends "maxFileLength" | "getFileType" | "setFileType" | "getFileLength" | "setFileLength" | "getFileChecksum" | "setFileChecksum" | "setFileTransferCommand" | "fileTransferStatus" | "getFileBlock" | "setFileBlock" | "fileBytesTransferred" | "fileTransferProgress" | "fileTransferComplete" | "fileReceived" | "
|
|
694
|
+
get addEventListener(): <T extends "pressure" | "getFileTypes" | "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" | "tapDetector" | "barometer" | "camera" | "cameraStatus" | "cameraCommand" | "getCameraConfiguration" | "setCameraConfiguration" | "cameraData" | "cameraImageProgress" | "cameraImage" | "getPressurePositions" | "getSensorScalars" | "sensorData" | "getSensorConfiguration" | "setSensorConfiguration" | "getTfliteName" | "setTfliteName" | "getTfliteTask" | "setTfliteTask" | "getTfliteSampleRate" | "setTfliteSampleRate" | "getTfliteSensorTypes" | "setTfliteSensorTypes" | "tfliteIsReady" | "getTfliteCaptureDelay" | "setTfliteCaptureDelay" | "getTfliteThreshold" | "setTfliteThreshold" | "getTfliteInferencingEnabled" | "setTfliteInferencingEnabled" | "tfliteInference" | "manufacturerName" | "modelNumber" | "hardwareRevision" | "firmwareRevision" | "softwareRevision" | "pnpId" | "serialNumber" | "deviceInformation" | "isCharging" | "getBatteryCurrent" | "getMtu" | "getId" | "getName" | "setName" | "getType" | "setType" | "getCurrentTime" | "setCurrentTime" | "getVibrationLocations" | "triggerVibration" | "isWifiAvailable" | "getWifiSSID" | "setWifiSSID" | "getWifiPassword" | "setWifiPassword" | "getWifiConnectionEnabled" | "setWifiConnectionEnabled" | "isWifiConnected" | "ipAddress" | "isWifiSecure" | "notConnected" | "connecting" | "connected" | "disconnecting" | "connectionStatus" | "isConnected" | "smp" | "batteryLevel" | "rx" | "tx" | "firmwareImages" | "firmwareUploadProgress" | "firmwareStatus" | "firmwareUploadComplete" | "connectionMessage">(type: T, listener: (event: {
|
|
576
695
|
type: T;
|
|
577
696
|
target: Device;
|
|
578
697
|
message: DeviceEventMessages[T];
|
|
579
698
|
}) => void, options?: {
|
|
580
699
|
once?: boolean;
|
|
581
700
|
}) => void;
|
|
582
|
-
get removeEventListener(): <T extends "maxFileLength" | "getFileType" | "setFileType" | "getFileLength" | "setFileLength" | "getFileChecksum" | "setFileChecksum" | "setFileTransferCommand" | "fileTransferStatus" | "getFileBlock" | "setFileBlock" | "fileBytesTransferred" | "fileTransferProgress" | "fileTransferComplete" | "fileReceived" | "
|
|
701
|
+
get removeEventListener(): <T extends "pressure" | "getFileTypes" | "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" | "tapDetector" | "barometer" | "camera" | "cameraStatus" | "cameraCommand" | "getCameraConfiguration" | "setCameraConfiguration" | "cameraData" | "cameraImageProgress" | "cameraImage" | "getPressurePositions" | "getSensorScalars" | "sensorData" | "getSensorConfiguration" | "setSensorConfiguration" | "getTfliteName" | "setTfliteName" | "getTfliteTask" | "setTfliteTask" | "getTfliteSampleRate" | "setTfliteSampleRate" | "getTfliteSensorTypes" | "setTfliteSensorTypes" | "tfliteIsReady" | "getTfliteCaptureDelay" | "setTfliteCaptureDelay" | "getTfliteThreshold" | "setTfliteThreshold" | "getTfliteInferencingEnabled" | "setTfliteInferencingEnabled" | "tfliteInference" | "manufacturerName" | "modelNumber" | "hardwareRevision" | "firmwareRevision" | "softwareRevision" | "pnpId" | "serialNumber" | "deviceInformation" | "isCharging" | "getBatteryCurrent" | "getMtu" | "getId" | "getName" | "setName" | "getType" | "setType" | "getCurrentTime" | "setCurrentTime" | "getVibrationLocations" | "triggerVibration" | "isWifiAvailable" | "getWifiSSID" | "setWifiSSID" | "getWifiPassword" | "setWifiPassword" | "getWifiConnectionEnabled" | "setWifiConnectionEnabled" | "isWifiConnected" | "ipAddress" | "isWifiSecure" | "notConnected" | "connecting" | "connected" | "disconnecting" | "connectionStatus" | "isConnected" | "smp" | "batteryLevel" | "rx" | "tx" | "firmwareImages" | "firmwareUploadProgress" | "firmwareStatus" | "firmwareUploadComplete" | "connectionMessage">(type: T, listener: (event: {
|
|
583
702
|
type: T;
|
|
584
703
|
target: Device;
|
|
585
704
|
message: DeviceEventMessages[T];
|
|
586
705
|
}) => void) => void;
|
|
587
|
-
get waitForEvent(): <T extends "maxFileLength" | "getFileType" | "setFileType" | "getFileLength" | "setFileLength" | "getFileChecksum" | "setFileChecksum" | "setFileTransferCommand" | "fileTransferStatus" | "getFileBlock" | "setFileBlock" | "fileBytesTransferred" | "fileTransferProgress" | "fileTransferComplete" | "fileReceived" | "
|
|
706
|
+
get waitForEvent(): <T extends "pressure" | "getFileTypes" | "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" | "tapDetector" | "barometer" | "camera" | "cameraStatus" | "cameraCommand" | "getCameraConfiguration" | "setCameraConfiguration" | "cameraData" | "cameraImageProgress" | "cameraImage" | "getPressurePositions" | "getSensorScalars" | "sensorData" | "getSensorConfiguration" | "setSensorConfiguration" | "getTfliteName" | "setTfliteName" | "getTfliteTask" | "setTfliteTask" | "getTfliteSampleRate" | "setTfliteSampleRate" | "getTfliteSensorTypes" | "setTfliteSensorTypes" | "tfliteIsReady" | "getTfliteCaptureDelay" | "setTfliteCaptureDelay" | "getTfliteThreshold" | "setTfliteThreshold" | "getTfliteInferencingEnabled" | "setTfliteInferencingEnabled" | "tfliteInference" | "manufacturerName" | "modelNumber" | "hardwareRevision" | "firmwareRevision" | "softwareRevision" | "pnpId" | "serialNumber" | "deviceInformation" | "isCharging" | "getBatteryCurrent" | "getMtu" | "getId" | "getName" | "setName" | "getType" | "setType" | "getCurrentTime" | "setCurrentTime" | "getVibrationLocations" | "triggerVibration" | "isWifiAvailable" | "getWifiSSID" | "setWifiSSID" | "getWifiPassword" | "setWifiPassword" | "getWifiConnectionEnabled" | "setWifiConnectionEnabled" | "isWifiConnected" | "ipAddress" | "isWifiSecure" | "notConnected" | "connecting" | "connected" | "disconnecting" | "connectionStatus" | "isConnected" | "smp" | "batteryLevel" | "rx" | "tx" | "firmwareImages" | "firmwareUploadProgress" | "firmwareStatus" | "firmwareUploadComplete" | "connectionMessage">(type: T) => Promise<{
|
|
588
707
|
type: T;
|
|
589
708
|
target: Device;
|
|
590
709
|
message: DeviceEventMessages[T];
|
|
591
710
|
}>;
|
|
592
|
-
get removeEventListeners(): <T extends "maxFileLength" | "getFileType" | "setFileType" | "getFileLength" | "setFileLength" | "getFileChecksum" | "setFileChecksum" | "setFileTransferCommand" | "fileTransferStatus" | "getFileBlock" | "setFileBlock" | "fileBytesTransferred" | "fileTransferProgress" | "fileTransferComplete" | "fileReceived" | "
|
|
711
|
+
get removeEventListeners(): <T extends "pressure" | "getFileTypes" | "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" | "tapDetector" | "barometer" | "camera" | "cameraStatus" | "cameraCommand" | "getCameraConfiguration" | "setCameraConfiguration" | "cameraData" | "cameraImageProgress" | "cameraImage" | "getPressurePositions" | "getSensorScalars" | "sensorData" | "getSensorConfiguration" | "setSensorConfiguration" | "getTfliteName" | "setTfliteName" | "getTfliteTask" | "setTfliteTask" | "getTfliteSampleRate" | "setTfliteSampleRate" | "getTfliteSensorTypes" | "setTfliteSensorTypes" | "tfliteIsReady" | "getTfliteCaptureDelay" | "setTfliteCaptureDelay" | "getTfliteThreshold" | "setTfliteThreshold" | "getTfliteInferencingEnabled" | "setTfliteInferencingEnabled" | "tfliteInference" | "manufacturerName" | "modelNumber" | "hardwareRevision" | "firmwareRevision" | "softwareRevision" | "pnpId" | "serialNumber" | "deviceInformation" | "isCharging" | "getBatteryCurrent" | "getMtu" | "getId" | "getName" | "setName" | "getType" | "setType" | "getCurrentTime" | "setCurrentTime" | "getVibrationLocations" | "triggerVibration" | "isWifiAvailable" | "getWifiSSID" | "setWifiSSID" | "getWifiPassword" | "setWifiPassword" | "getWifiConnectionEnabled" | "setWifiConnectionEnabled" | "isWifiConnected" | "ipAddress" | "isWifiSecure" | "notConnected" | "connecting" | "connected" | "disconnecting" | "connectionStatus" | "isConnected" | "smp" | "batteryLevel" | "rx" | "tx" | "firmwareImages" | "firmwareUploadProgress" | "firmwareStatus" | "firmwareUploadComplete" | "connectionMessage">(type: T) => void;
|
|
593
712
|
get removeAllEventListeners(): () => void;
|
|
594
713
|
get connectionManager(): BaseConnectionManager | undefined;
|
|
595
714
|
set connectionManager(newConnectionManager: BaseConnectionManager | undefined);
|
|
596
715
|
private sendTxMessages;
|
|
597
|
-
connect(): Promise<void>;
|
|
716
|
+
connect(options?: ConnectOptions): Promise<void>;
|
|
598
717
|
get isConnected(): boolean;
|
|
599
718
|
get canReconnect(): boolean | undefined;
|
|
600
719
|
reconnect(): Promise<void | undefined>;
|
|
@@ -603,12 +722,12 @@ declare class Device {
|
|
|
603
722
|
static set ReconnectOnDisconnection(newReconnectOnDisconnection: boolean);
|
|
604
723
|
get reconnectOnDisconnection(): boolean;
|
|
605
724
|
set reconnectOnDisconnection(newReconnectOnDisconnection: boolean);
|
|
606
|
-
get connectionType(): "webBluetooth" | "noble" | "client" | undefined;
|
|
725
|
+
get connectionType(): "webBluetooth" | "noble" | "client" | "webSocket" | "udp" | undefined;
|
|
607
726
|
disconnect(): Promise<void>;
|
|
608
727
|
toggleConnection(): void;
|
|
609
728
|
get connectionStatus(): ConnectionStatus;
|
|
610
729
|
get isConnectionBusy(): boolean;
|
|
611
|
-
|
|
730
|
+
latestConnectionMessages: Map<ConnectionMessageType, DataView>;
|
|
612
731
|
get deviceInformation(): DeviceInformation;
|
|
613
732
|
get batteryLevel(): number;
|
|
614
733
|
/** @private */
|
|
@@ -619,13 +738,14 @@ declare class Device {
|
|
|
619
738
|
get getBatteryCurrent(): () => Promise<void>;
|
|
620
739
|
get name(): string;
|
|
621
740
|
get setName(): (newName: string) => Promise<void>;
|
|
622
|
-
get type(): "leftInsole" | "rightInsole";
|
|
741
|
+
get type(): "leftInsole" | "rightInsole" | "leftGlove" | "rightGlove" | "glasses" | "generic";
|
|
623
742
|
get setType(): (newType: DeviceType) => Promise<void>;
|
|
624
743
|
get isInsole(): boolean;
|
|
625
|
-
get
|
|
744
|
+
get isGlove(): boolean;
|
|
745
|
+
get side(): "left" | "right";
|
|
626
746
|
get mtu(): number;
|
|
627
747
|
get sensorTypes(): SensorType[];
|
|
628
|
-
get continuousSensorTypes(): ("pressure" | "acceleration" | "gravity" | "linearAcceleration" | "gyroscope" | "magnetometer" | "gameRotation" | "rotation" | "barometer")[];
|
|
748
|
+
get continuousSensorTypes(): ("pressure" | "acceleration" | "gravity" | "linearAcceleration" | "gyroscope" | "magnetometer" | "gameRotation" | "rotation" | "orientation" | "barometer")[];
|
|
629
749
|
get sensorConfiguration(): SensorConfiguration;
|
|
630
750
|
setSensorConfiguration(newSensorConfiguration: SensorConfiguration, clearRest?: boolean): Promise<void>;
|
|
631
751
|
clearSensorConfiguration(): Promise<void>;
|
|
@@ -635,20 +755,24 @@ declare class Device {
|
|
|
635
755
|
set clearSensorConfigurationOnLeave(newClearSensorConfigurationOnLeave: boolean);
|
|
636
756
|
get numberOfPressureSensors(): number;
|
|
637
757
|
resetPressureRange(): void;
|
|
758
|
+
get vibrationLocations(): ("front" | "rear")[];
|
|
638
759
|
triggerVibration(vibrationConfigurations: VibrationConfiguration[], sendImmediately?: boolean): Promise<void>;
|
|
760
|
+
get fileTypes(): ("tflite" | "wifiServerCert" | "wifiServerKey")[];
|
|
639
761
|
get maxFileLength(): number;
|
|
762
|
+
get validFileTypes(): ("tflite" | "wifiServerCert" | "wifiServerKey")[];
|
|
640
763
|
sendFile(fileType: FileType, file: FileLike): Promise<void>;
|
|
641
764
|
receiveFile(fileType: FileType): Promise<void>;
|
|
642
765
|
get fileTransferStatus(): "idle" | "sending" | "receiving";
|
|
643
766
|
cancelFileTransfer(): void;
|
|
644
767
|
get tfliteName(): string;
|
|
645
768
|
get setTfliteName(): (newName: string, sendImmediately?: boolean) => Promise<void>;
|
|
769
|
+
sendTfliteConfiguration(configuration: TfliteFileConfiguration): Promise<void>;
|
|
646
770
|
get tfliteTask(): "classification" | "regression";
|
|
647
771
|
get setTfliteTask(): (newTask: TfliteTask, sendImmediately?: boolean) => Promise<void>;
|
|
648
772
|
get tfliteSampleRate(): number;
|
|
649
773
|
get setTfliteSampleRate(): (newSampleRate: number, sendImmediately?: boolean) => Promise<void>;
|
|
650
|
-
get tfliteSensorTypes(): ("pressure" | "
|
|
651
|
-
get allowedTfliteSensorTypes(): ("pressure" | "acceleration" | "gravity" | "linearAcceleration" | "gyroscope" | "magnetometer" | "gameRotation" | "rotation" | "orientation" | "activity" | "stepCounter" | "stepDetector" | "deviceOrientation" | "barometer")[];
|
|
774
|
+
get tfliteSensorTypes(): ("pressure" | "linearAcceleration" | "gyroscope" | "magnetometer")[];
|
|
775
|
+
get allowedTfliteSensorTypes(): ("pressure" | "acceleration" | "gravity" | "linearAcceleration" | "gyroscope" | "magnetometer" | "gameRotation" | "rotation" | "orientation" | "activity" | "stepCounter" | "stepDetector" | "deviceOrientation" | "tapDetector" | "barometer" | "camera")[];
|
|
652
776
|
get setTfliteSensorTypes(): (newSensorTypes: SensorType[], sendImmediately?: boolean) => Promise<void>;
|
|
653
777
|
get tfliteIsReady(): boolean;
|
|
654
778
|
get tfliteInferencingEnabled(): boolean;
|
|
@@ -660,8 +784,10 @@ declare class Device {
|
|
|
660
784
|
get setTfliteCaptureDelay(): (newCaptureDelay: number, sendImmediately: boolean) => Promise<void>;
|
|
661
785
|
get tfliteThreshold(): number;
|
|
662
786
|
get setTfliteThreshold(): (newThreshold: number, sendImmediately: boolean) => Promise<void>;
|
|
787
|
+
get canUpdateFirmware(): boolean | undefined;
|
|
663
788
|
private sendSmpMessage;
|
|
664
789
|
get uploadFirmware(): (file: FileLike) => Promise<void>;
|
|
790
|
+
get canReset(): boolean | undefined;
|
|
665
791
|
reset(): Promise<void>;
|
|
666
792
|
get firmwareStatus(): "idle" | "uploading" | "uploaded" | "pending" | "testing" | "erasing";
|
|
667
793
|
get getFirmwareImages(): () => Promise<void>;
|
|
@@ -671,6 +797,33 @@ declare class Device {
|
|
|
671
797
|
get testFirmwareImage(): (imageIndex?: number) => Promise<void>;
|
|
672
798
|
get isServerSide(): boolean;
|
|
673
799
|
set isServerSide(newIsServerSide: boolean);
|
|
800
|
+
get isUkaton(): boolean;
|
|
801
|
+
get isWifiAvailable(): boolean;
|
|
802
|
+
get wifiSSID(): string;
|
|
803
|
+
setWifiSSID(newWifiSSID: string): Promise<void>;
|
|
804
|
+
get wifiPassword(): string;
|
|
805
|
+
setWifiPassword(newWifiPassword: string): Promise<void>;
|
|
806
|
+
get isWifiConnected(): boolean;
|
|
807
|
+
get ipAddress(): string | undefined;
|
|
808
|
+
get wifiConnectionEnabled(): boolean;
|
|
809
|
+
get enableWifiConnection(): () => Promise<void>;
|
|
810
|
+
get setWifiConnectionEnabled(): (newWifiConnectionEnabled: boolean, sendImmediately?: boolean) => Promise<void>;
|
|
811
|
+
get disableWifiConnection(): () => Promise<void>;
|
|
812
|
+
get toggleWifiConnection(): () => Promise<void>;
|
|
813
|
+
get isWifiSecure(): boolean;
|
|
814
|
+
reconnectViaWebSockets(): Promise<void>;
|
|
815
|
+
reconnectViaUDP(): Promise<void>;
|
|
816
|
+
get hasCamera(): boolean;
|
|
817
|
+
get cameraStatus(): "idle" | "focusing" | "takingPicture" | "asleep";
|
|
818
|
+
takePicture(): Promise<void>;
|
|
819
|
+
focusCamera(): Promise<void>;
|
|
820
|
+
stopCamera(): Promise<void>;
|
|
821
|
+
wakeCamera(): Promise<void>;
|
|
822
|
+
sleepCamera(): Promise<void>;
|
|
823
|
+
get cameraConfiguration(): CameraConfiguration;
|
|
824
|
+
get availableCameraConfigurationTypes(): ("resolution" | "qualityFactor" | "shutter" | "gain" | "redGain" | "greenGain" | "blueGain")[];
|
|
825
|
+
get cameraConfigurationRanges(): CameraConfigurationRanges;
|
|
826
|
+
get setCameraConfiguration(): (newCameraConfiguration: CameraConfiguration) => Promise<void>;
|
|
674
827
|
}
|
|
675
828
|
|
|
676
829
|
declare const DeviceManagerEventTypes: readonly ["deviceConnected", "deviceDisconnected", "deviceIsConnected", "availableDevices", "connectedDevices"];
|
|
@@ -727,11 +880,15 @@ declare class DeviceManager {
|
|
|
727
880
|
}) => void) => void;
|
|
728
881
|
get RemoveEventListeners(): <T extends "deviceConnected" | "deviceDisconnected" | "deviceIsConnected" | "availableDevices" | "connectedDevices">(type: T) => void;
|
|
729
882
|
get RemoveAllEventListeners(): () => void;
|
|
883
|
+
_CheckDeviceAvailability(device: Device): void;
|
|
730
884
|
}
|
|
731
885
|
declare const _default: DeviceManager;
|
|
732
886
|
|
|
733
887
|
interface DevicePairPressureData {
|
|
734
|
-
|
|
888
|
+
sensors: {
|
|
889
|
+
[key in Side]: PressureSensorValue[];
|
|
890
|
+
};
|
|
891
|
+
scaledSum: number;
|
|
735
892
|
normalizedSum: number;
|
|
736
893
|
center?: CenterOfPressure;
|
|
737
894
|
normalizedCenter?: CenterOfPressure;
|
|
@@ -744,7 +901,7 @@ interface DevicePairPressureDataEventMessages {
|
|
|
744
901
|
}
|
|
745
902
|
|
|
746
903
|
type DevicePairSensorDataTimestamps = {
|
|
747
|
-
[
|
|
904
|
+
[side in Side]: number;
|
|
748
905
|
};
|
|
749
906
|
interface BaseDevicePairSensorDataEventMessage {
|
|
750
907
|
timestamps: DevicePairSensorDataTimestamps;
|
|
@@ -759,7 +916,7 @@ type DevicePairSensorDataEventMessages = _DevicePairSensorDataEventMessages & An
|
|
|
759
916
|
|
|
760
917
|
interface BaseDevicePairDeviceEventMessage {
|
|
761
918
|
device: Device;
|
|
762
|
-
side:
|
|
919
|
+
side: Side;
|
|
763
920
|
}
|
|
764
921
|
type DevicePairDeviceEventMessages = ExtendInterfaceValues<AddPrefixToInterfaceKeys<DeviceEventMessages, "device">, BaseDevicePairDeviceEventMessage>;
|
|
765
922
|
interface DevicePairConnectionEventMessages {
|
|
@@ -772,46 +929,61 @@ type DevicePairEventMap = EventMap<DevicePair, DeviceEventType, DevicePairEventM
|
|
|
772
929
|
type DevicePairEventListenerMap = EventListenerMap<DevicePair, DeviceEventType, DevicePairEventMessages>;
|
|
773
930
|
type DevicePairEvent = Event<DevicePair, DeviceEventType, DevicePairEventMessages>;
|
|
774
931
|
type BoundDevicePairEventListeners = BoundEventListeners<DevicePair, DeviceEventType, DevicePairEventMessages>;
|
|
932
|
+
declare const DevicePairTypes: readonly ["insoles", "gloves"];
|
|
933
|
+
type DevicePairType = (typeof DevicePairTypes)[number];
|
|
775
934
|
declare class DevicePair {
|
|
776
935
|
#private;
|
|
777
|
-
constructor();
|
|
936
|
+
constructor(type: DevicePairType);
|
|
778
937
|
get sides(): readonly ["left", "right"];
|
|
779
|
-
get
|
|
938
|
+
get type(): "insoles" | "gloves";
|
|
939
|
+
get addEventListener(): <T extends "pressure" | "deviceOrientation" | "sensorData" | "isConnected" | "deviceConnected" | "deviceIsConnected" | "devicePressure" | "deviceGetFileTypes" | "deviceMaxFileLength" | "deviceGetFileType" | "deviceGetFileLength" | "deviceGetFileChecksum" | "deviceFileTransferStatus" | "deviceGetFileBlock" | "deviceFileTransferProgress" | "deviceFileTransferComplete" | "deviceFileReceived" | "deviceAcceleration" | "deviceGravity" | "deviceLinearAcceleration" | "deviceGyroscope" | "deviceMagnetometer" | "deviceGameRotation" | "deviceRotation" | "deviceActivity" | "deviceStepCounter" | "deviceStepDetector" | "deviceDeviceOrientation" | "deviceTapDetector" | "deviceBarometer" | "deviceCameraStatus" | "deviceGetCameraConfiguration" | "deviceCameraImageProgress" | "deviceCameraImage" | "deviceSensorData" | "deviceGetSensorConfiguration" | "deviceGetTfliteName" | "deviceGetTfliteTask" | "deviceGetTfliteSampleRate" | "deviceGetTfliteSensorTypes" | "deviceTfliteIsReady" | "deviceGetTfliteCaptureDelay" | "deviceGetTfliteThreshold" | "deviceGetTfliteInferencingEnabled" | "deviceTfliteInference" | "deviceManufacturerName" | "deviceModelNumber" | "deviceHardwareRevision" | "deviceFirmwareRevision" | "deviceSoftwareRevision" | "devicePnpId" | "deviceSerialNumber" | "deviceDeviceInformation" | "deviceIsCharging" | "deviceGetBatteryCurrent" | "deviceGetMtu" | "deviceGetId" | "deviceGetName" | "deviceGetType" | "deviceGetCurrentTime" | "deviceIsWifiAvailable" | "deviceGetWifiSSID" | "deviceGetWifiPassword" | "deviceIsWifiConnected" | "deviceIpAddress" | "deviceNotConnected" | "deviceConnecting" | "deviceDisconnecting" | "deviceConnectionStatus" | "deviceSmp" | "deviceBatteryLevel" | "deviceFirmwareImages" | "deviceFirmwareUploadProgress" | "deviceFirmwareStatus" | "deviceConnectionMessage" | "deviceGetEnableWifiConnection">(type: T, listener: (event: {
|
|
780
940
|
type: T;
|
|
781
941
|
target: DevicePair;
|
|
782
942
|
message: DevicePairEventMessages[T];
|
|
783
943
|
}) => void, options?: {
|
|
784
944
|
once?: boolean;
|
|
785
945
|
}) => void;
|
|
786
|
-
get removeEventListener(): <T extends "pressure" | "deviceOrientation" | "sensorData" | "isConnected" | "deviceConnected" | "deviceIsConnected" | "deviceMaxFileLength" | "deviceGetFileType" | "deviceGetFileLength" | "deviceGetFileChecksum" | "deviceFileTransferStatus" | "deviceGetFileBlock" | "deviceFileTransferProgress" | "deviceFileTransferComplete" | "deviceFileReceived" | "
|
|
946
|
+
get removeEventListener(): <T extends "pressure" | "deviceOrientation" | "sensorData" | "isConnected" | "deviceConnected" | "deviceIsConnected" | "devicePressure" | "deviceGetFileTypes" | "deviceMaxFileLength" | "deviceGetFileType" | "deviceGetFileLength" | "deviceGetFileChecksum" | "deviceFileTransferStatus" | "deviceGetFileBlock" | "deviceFileTransferProgress" | "deviceFileTransferComplete" | "deviceFileReceived" | "deviceAcceleration" | "deviceGravity" | "deviceLinearAcceleration" | "deviceGyroscope" | "deviceMagnetometer" | "deviceGameRotation" | "deviceRotation" | "deviceActivity" | "deviceStepCounter" | "deviceStepDetector" | "deviceDeviceOrientation" | "deviceTapDetector" | "deviceBarometer" | "deviceCameraStatus" | "deviceGetCameraConfiguration" | "deviceCameraImageProgress" | "deviceCameraImage" | "deviceSensorData" | "deviceGetSensorConfiguration" | "deviceGetTfliteName" | "deviceGetTfliteTask" | "deviceGetTfliteSampleRate" | "deviceGetTfliteSensorTypes" | "deviceTfliteIsReady" | "deviceGetTfliteCaptureDelay" | "deviceGetTfliteThreshold" | "deviceGetTfliteInferencingEnabled" | "deviceTfliteInference" | "deviceManufacturerName" | "deviceModelNumber" | "deviceHardwareRevision" | "deviceFirmwareRevision" | "deviceSoftwareRevision" | "devicePnpId" | "deviceSerialNumber" | "deviceDeviceInformation" | "deviceIsCharging" | "deviceGetBatteryCurrent" | "deviceGetMtu" | "deviceGetId" | "deviceGetName" | "deviceGetType" | "deviceGetCurrentTime" | "deviceIsWifiAvailable" | "deviceGetWifiSSID" | "deviceGetWifiPassword" | "deviceIsWifiConnected" | "deviceIpAddress" | "deviceNotConnected" | "deviceConnecting" | "deviceDisconnecting" | "deviceConnectionStatus" | "deviceSmp" | "deviceBatteryLevel" | "deviceFirmwareImages" | "deviceFirmwareUploadProgress" | "deviceFirmwareStatus" | "deviceConnectionMessage" | "deviceGetEnableWifiConnection">(type: T, listener: (event: {
|
|
787
947
|
type: T;
|
|
788
948
|
target: DevicePair;
|
|
789
949
|
message: DevicePairEventMessages[T];
|
|
790
950
|
}) => void) => void;
|
|
791
|
-
get waitForEvent(): <T extends "pressure" | "deviceOrientation" | "sensorData" | "isConnected" | "deviceConnected" | "deviceIsConnected" | "deviceMaxFileLength" | "deviceGetFileType" | "deviceGetFileLength" | "deviceGetFileChecksum" | "deviceFileTransferStatus" | "deviceGetFileBlock" | "deviceFileTransferProgress" | "deviceFileTransferComplete" | "deviceFileReceived" | "
|
|
951
|
+
get waitForEvent(): <T extends "pressure" | "deviceOrientation" | "sensorData" | "isConnected" | "deviceConnected" | "deviceIsConnected" | "devicePressure" | "deviceGetFileTypes" | "deviceMaxFileLength" | "deviceGetFileType" | "deviceGetFileLength" | "deviceGetFileChecksum" | "deviceFileTransferStatus" | "deviceGetFileBlock" | "deviceFileTransferProgress" | "deviceFileTransferComplete" | "deviceFileReceived" | "deviceAcceleration" | "deviceGravity" | "deviceLinearAcceleration" | "deviceGyroscope" | "deviceMagnetometer" | "deviceGameRotation" | "deviceRotation" | "deviceActivity" | "deviceStepCounter" | "deviceStepDetector" | "deviceDeviceOrientation" | "deviceTapDetector" | "deviceBarometer" | "deviceCameraStatus" | "deviceGetCameraConfiguration" | "deviceCameraImageProgress" | "deviceCameraImage" | "deviceSensorData" | "deviceGetSensorConfiguration" | "deviceGetTfliteName" | "deviceGetTfliteTask" | "deviceGetTfliteSampleRate" | "deviceGetTfliteSensorTypes" | "deviceTfliteIsReady" | "deviceGetTfliteCaptureDelay" | "deviceGetTfliteThreshold" | "deviceGetTfliteInferencingEnabled" | "deviceTfliteInference" | "deviceManufacturerName" | "deviceModelNumber" | "deviceHardwareRevision" | "deviceFirmwareRevision" | "deviceSoftwareRevision" | "devicePnpId" | "deviceSerialNumber" | "deviceDeviceInformation" | "deviceIsCharging" | "deviceGetBatteryCurrent" | "deviceGetMtu" | "deviceGetId" | "deviceGetName" | "deviceGetType" | "deviceGetCurrentTime" | "deviceIsWifiAvailable" | "deviceGetWifiSSID" | "deviceGetWifiPassword" | "deviceIsWifiConnected" | "deviceIpAddress" | "deviceNotConnected" | "deviceConnecting" | "deviceDisconnecting" | "deviceConnectionStatus" | "deviceSmp" | "deviceBatteryLevel" | "deviceFirmwareImages" | "deviceFirmwareUploadProgress" | "deviceFirmwareStatus" | "deviceConnectionMessage" | "deviceGetEnableWifiConnection">(type: T) => Promise<{
|
|
792
952
|
type: T;
|
|
793
953
|
target: DevicePair;
|
|
794
954
|
message: DevicePairEventMessages[T];
|
|
795
955
|
}>;
|
|
796
|
-
get removeEventListeners(): <T extends "pressure" | "deviceOrientation" | "sensorData" | "isConnected" | "deviceConnected" | "deviceIsConnected" | "deviceMaxFileLength" | "deviceGetFileType" | "deviceGetFileLength" | "deviceGetFileChecksum" | "deviceFileTransferStatus" | "deviceGetFileBlock" | "deviceFileTransferProgress" | "deviceFileTransferComplete" | "deviceFileReceived" | "
|
|
956
|
+
get removeEventListeners(): <T extends "pressure" | "deviceOrientation" | "sensorData" | "isConnected" | "deviceConnected" | "deviceIsConnected" | "devicePressure" | "deviceGetFileTypes" | "deviceMaxFileLength" | "deviceGetFileType" | "deviceGetFileLength" | "deviceGetFileChecksum" | "deviceFileTransferStatus" | "deviceGetFileBlock" | "deviceFileTransferProgress" | "deviceFileTransferComplete" | "deviceFileReceived" | "deviceAcceleration" | "deviceGravity" | "deviceLinearAcceleration" | "deviceGyroscope" | "deviceMagnetometer" | "deviceGameRotation" | "deviceRotation" | "deviceActivity" | "deviceStepCounter" | "deviceStepDetector" | "deviceDeviceOrientation" | "deviceTapDetector" | "deviceBarometer" | "deviceCameraStatus" | "deviceGetCameraConfiguration" | "deviceCameraImageProgress" | "deviceCameraImage" | "deviceSensorData" | "deviceGetSensorConfiguration" | "deviceGetTfliteName" | "deviceGetTfliteTask" | "deviceGetTfliteSampleRate" | "deviceGetTfliteSensorTypes" | "deviceTfliteIsReady" | "deviceGetTfliteCaptureDelay" | "deviceGetTfliteThreshold" | "deviceGetTfliteInferencingEnabled" | "deviceTfliteInference" | "deviceManufacturerName" | "deviceModelNumber" | "deviceHardwareRevision" | "deviceFirmwareRevision" | "deviceSoftwareRevision" | "devicePnpId" | "deviceSerialNumber" | "deviceDeviceInformation" | "deviceIsCharging" | "deviceGetBatteryCurrent" | "deviceGetMtu" | "deviceGetId" | "deviceGetName" | "deviceGetType" | "deviceGetCurrentTime" | "deviceIsWifiAvailable" | "deviceGetWifiSSID" | "deviceGetWifiPassword" | "deviceIsWifiConnected" | "deviceIpAddress" | "deviceNotConnected" | "deviceConnecting" | "deviceDisconnecting" | "deviceConnectionStatus" | "deviceSmp" | "deviceBatteryLevel" | "deviceFirmwareImages" | "deviceFirmwareUploadProgress" | "deviceFirmwareStatus" | "deviceConnectionMessage" | "deviceGetEnableWifiConnection">(type: T) => void;
|
|
797
957
|
get removeAllEventListeners(): () => void;
|
|
798
958
|
get left(): Device | undefined;
|
|
799
959
|
get right(): Device | undefined;
|
|
800
960
|
get isConnected(): boolean;
|
|
801
961
|
get isPartiallyConnected(): boolean;
|
|
802
962
|
get isHalfConnected(): boolean;
|
|
803
|
-
|
|
963
|
+
assignDevice(device: Device): Device | undefined;
|
|
804
964
|
setSensorConfiguration(sensorConfiguration: SensorConfiguration): Promise<void>;
|
|
805
965
|
resetPressureRange(): void;
|
|
806
966
|
triggerVibration(vibrationConfigurations: VibrationConfiguration[], sendImmediately?: boolean): Promise<PromiseSettledResult<void | undefined>[]>;
|
|
807
|
-
static get
|
|
967
|
+
static get insoles(): DevicePair;
|
|
968
|
+
static get gloves(): DevicePair;
|
|
808
969
|
}
|
|
809
970
|
|
|
971
|
+
type BoundGenericEventListeners = {
|
|
972
|
+
[eventType: string]: Function;
|
|
973
|
+
};
|
|
974
|
+
declare function addEventListeners(target: any, boundEventListeners: BoundGenericEventListeners): void;
|
|
975
|
+
declare function removeEventListeners(target: any, boundEventListeners: BoundGenericEventListeners): void;
|
|
976
|
+
|
|
977
|
+
declare function throttle<T extends (...args: any[]) => void>(fn: T, interval: number, trailing?: boolean): (...args: Parameters<T>) => void;
|
|
978
|
+
declare function debounce<T extends (...args: any[]) => void>(fn: T, interval: number, callImmediately?: boolean): (...args: Parameters<T>) => void;
|
|
979
|
+
|
|
810
980
|
interface DiscoveredDevice {
|
|
811
981
|
bluetoothId: string;
|
|
812
982
|
name: string;
|
|
813
983
|
deviceType: DeviceType;
|
|
814
984
|
rssi: number;
|
|
985
|
+
ipAddress?: string;
|
|
986
|
+
isWifiSecure?: boolean;
|
|
815
987
|
}
|
|
816
988
|
interface ScannerDiscoveredDeviceEventMessage {
|
|
817
989
|
discoveredDevice: DiscoveredDevice;
|
|
@@ -860,7 +1032,7 @@ declare abstract class BaseScanner {
|
|
|
860
1032
|
get discoveredDevices(): Readonly<DiscoveredDevicesMap>;
|
|
861
1033
|
get discoveredDevicesArray(): DiscoveredDevice[];
|
|
862
1034
|
static get DiscoveredDeviceExpirationTimeout(): number;
|
|
863
|
-
connectToDevice(deviceId: string): Promise<void>;
|
|
1035
|
+
connectToDevice(deviceId: string, connectionType?: ConnectionType): Promise<void>;
|
|
864
1036
|
get canReset(): boolean;
|
|
865
1037
|
reset(): void;
|
|
866
1038
|
}
|
|
@@ -928,4 +1100,14 @@ declare class UDPServer extends BaseServer {
|
|
|
928
1100
|
broadcastMessage(message: ArrayBuffer): void;
|
|
929
1101
|
}
|
|
930
1102
|
|
|
931
|
-
|
|
1103
|
+
declare const EventUtils: {
|
|
1104
|
+
addEventListeners: typeof addEventListeners;
|
|
1105
|
+
removeEventListeners: typeof removeEventListeners;
|
|
1106
|
+
};
|
|
1107
|
+
|
|
1108
|
+
declare const ThrottleUtils: {
|
|
1109
|
+
throttle: typeof throttle;
|
|
1110
|
+
debounce: typeof debounce;
|
|
1111
|
+
};
|
|
1112
|
+
|
|
1113
|
+
export { type BoundDeviceEventListeners, type BoundDeviceManagerEventListeners, type BoundDevicePairEventListeners, type CameraCommand, CameraCommands, type CameraConfiguration, type CameraConfigurationType, CameraConfigurationTypes, 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, EventUtils, type FileTransferDirection, FileTransferDirections, type FileType, FileTypes, MaxNameLength, MaxNumberOfVibrationWaveformEffectSegments, MaxNumberOfVibrationWaveformSegments, MaxSensorRate, MaxVibrationWaveformEffectSegmentDelay, MaxVibrationWaveformEffectSegmentLoopCount, MaxVibrationWaveformEffectSequenceLoopCount, MaxVibrationWaveformSegmentDuration, MaxWifiPasswordLength, MaxWifiSSIDLength, MinNameLength, MinWifiPasswordLength, MinWifiSSIDLength, type PressureData, type Quaternion, RangeHelper, scanner as Scanner, type SensorConfiguration, SensorRateStep, type SensorType, SensorTypes, type Side, Sides, type TfliteFileConfiguration, type TfliteSensorType, TfliteSensorTypes, type TfliteTask, TfliteTasks, ThrottleUtils, UDPServer, type Vector2, type Vector3, type VibrationConfiguration, type VibrationLocation, VibrationLocations, type VibrationType, VibrationTypes, type VibrationWaveformEffect, VibrationWaveformEffects, WebSocketServer, setAllConsoleLevelFlags, setConsoleLevelFlagsForType };
|