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.d.ts
CHANGED
|
@@ -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;
|
|
@@ -109,6 +146,41 @@ declare class EventDispatcher<Target extends any, EventType extends string, Even
|
|
|
109
146
|
}>;
|
|
110
147
|
}
|
|
111
148
|
|
|
149
|
+
declare const CameraCommands: readonly ["focus", "takePicture", "stop", "sleep", "wake"];
|
|
150
|
+
type CameraCommand = (typeof CameraCommands)[number];
|
|
151
|
+
declare const CameraStatuses: readonly ["idle", "focusing", "takingPicture", "asleep"];
|
|
152
|
+
type CameraStatus = (typeof CameraStatuses)[number];
|
|
153
|
+
declare const CameraDataTypes: readonly ["headerSize", "header", "imageSize", "image", "footerSize", "footer"];
|
|
154
|
+
type CameraDataType = (typeof CameraDataTypes)[number];
|
|
155
|
+
declare const CameraConfigurationTypes: readonly ["resolution", "qualityFactor", "shutter", "gain", "redGain", "greenGain", "blueGain"];
|
|
156
|
+
type CameraConfigurationType = (typeof CameraConfigurationTypes)[number];
|
|
157
|
+
type CameraConfiguration = {
|
|
158
|
+
[cameraConfigurationType in CameraConfigurationType]?: number;
|
|
159
|
+
};
|
|
160
|
+
type CameraConfigurationRanges = {
|
|
161
|
+
[cameraConfigurationType in CameraConfigurationType]: {
|
|
162
|
+
min: number;
|
|
163
|
+
max: number;
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
interface CameraEventMessages {
|
|
167
|
+
cameraStatus: {
|
|
168
|
+
cameraStatus: CameraStatus;
|
|
169
|
+
previousCameraStatus: CameraStatus;
|
|
170
|
+
};
|
|
171
|
+
getCameraConfiguration: {
|
|
172
|
+
cameraConfiguration: CameraConfiguration;
|
|
173
|
+
};
|
|
174
|
+
cameraImageProgress: {
|
|
175
|
+
progress: number;
|
|
176
|
+
type: CameraDataType;
|
|
177
|
+
};
|
|
178
|
+
cameraImage: {
|
|
179
|
+
blob: Blob;
|
|
180
|
+
url: string;
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
112
184
|
type FileLike = number[] | ArrayBuffer | DataView | URL | string | File;
|
|
113
185
|
|
|
114
186
|
declare const FirmwareStatuses: readonly ["idle", "uploading", "uploaded", "pending", "testing", "erasing"];
|
|
@@ -139,43 +211,6 @@ interface FirmwareEventMessages {
|
|
|
139
211
|
};
|
|
140
212
|
}
|
|
141
213
|
|
|
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
214
|
type ValueOf<T> = T[keyof T];
|
|
180
215
|
type AddProperty<T, Key extends string, Value> = T & {
|
|
181
216
|
[K in Key]: Value;
|
|
@@ -239,6 +274,9 @@ interface MotionSensorDataEventMessages {
|
|
|
239
274
|
deviceOrientation: {
|
|
240
275
|
deviceOrientation: DeviceOrientation;
|
|
241
276
|
};
|
|
277
|
+
tapDetector: {
|
|
278
|
+
tapDetector: Object;
|
|
279
|
+
};
|
|
242
280
|
}
|
|
243
281
|
|
|
244
282
|
interface BarometerSensorDataEventMessages {
|
|
@@ -247,9 +285,9 @@ interface BarometerSensorDataEventMessages {
|
|
|
247
285
|
};
|
|
248
286
|
}
|
|
249
287
|
|
|
250
|
-
declare const SensorTypes: readonly ["pressure", "acceleration", "gravity", "linearAcceleration", "gyroscope", "magnetometer", "gameRotation", "rotation", "orientation", "activity", "stepCounter", "stepDetector", "deviceOrientation", "barometer"];
|
|
288
|
+
declare const SensorTypes: readonly ["pressure", "acceleration", "gravity", "linearAcceleration", "gyroscope", "magnetometer", "gameRotation", "rotation", "orientation", "activity", "stepCounter", "stepDetector", "deviceOrientation", "tapDetector", "barometer", "camera"];
|
|
251
289
|
type SensorType = (typeof SensorTypes)[number];
|
|
252
|
-
declare const ContinuousSensorTypes: readonly ["pressure", "acceleration", "gravity", "linearAcceleration", "gyroscope", "magnetometer", "gameRotation", "rotation", "barometer"];
|
|
290
|
+
declare const ContinuousSensorTypes: readonly ["pressure", "acceleration", "gravity", "linearAcceleration", "gyroscope", "magnetometer", "gameRotation", "rotation", "orientation", "barometer"];
|
|
253
291
|
type ContinuousSensorType = (typeof ContinuousSensorTypes)[number];
|
|
254
292
|
interface BaseSensorDataEventMessage {
|
|
255
293
|
timestamp: number;
|
|
@@ -262,6 +300,49 @@ interface AnySensorDataEventMessages {
|
|
|
262
300
|
}
|
|
263
301
|
type SensorDataEventMessages = _SensorDataEventMessages & AnySensorDataEventMessages;
|
|
264
302
|
|
|
303
|
+
declare const FileTypes: readonly ["tflite", "wifiServerCert", "wifiServerKey"];
|
|
304
|
+
type FileType = (typeof FileTypes)[number];
|
|
305
|
+
declare const FileTransferStatuses: readonly ["idle", "sending", "receiving"];
|
|
306
|
+
type FileTransferStatus = (typeof FileTransferStatuses)[number];
|
|
307
|
+
declare const FileTransferDirections: readonly ["sending", "receiving"];
|
|
308
|
+
type FileTransferDirection = (typeof FileTransferDirections)[number];
|
|
309
|
+
interface FileConfiguration {
|
|
310
|
+
file: FileLike;
|
|
311
|
+
type: FileType;
|
|
312
|
+
}
|
|
313
|
+
interface FileTransferEventMessages {
|
|
314
|
+
getFileTypes: {
|
|
315
|
+
fileTypes: FileType[];
|
|
316
|
+
};
|
|
317
|
+
maxFileLength: {
|
|
318
|
+
maxFileLength: number;
|
|
319
|
+
};
|
|
320
|
+
getFileType: {
|
|
321
|
+
fileType: FileType;
|
|
322
|
+
};
|
|
323
|
+
getFileLength: {
|
|
324
|
+
fileLength: number;
|
|
325
|
+
};
|
|
326
|
+
getFileChecksum: {
|
|
327
|
+
fileChecksum: number;
|
|
328
|
+
};
|
|
329
|
+
fileTransferStatus: {
|
|
330
|
+
fileTransferStatus: FileTransferStatus;
|
|
331
|
+
};
|
|
332
|
+
getFileBlock: {
|
|
333
|
+
fileTransferBlock: DataView;
|
|
334
|
+
};
|
|
335
|
+
fileTransferProgress: {
|
|
336
|
+
progress: number;
|
|
337
|
+
};
|
|
338
|
+
fileTransferComplete: {
|
|
339
|
+
direction: FileTransferDirection;
|
|
340
|
+
};
|
|
341
|
+
fileReceived: {
|
|
342
|
+
file: File | Blob;
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
|
|
265
346
|
declare const TfliteTasks: readonly ["classification", "regression"];
|
|
266
347
|
type TfliteTask = (typeof TfliteTasks)[number];
|
|
267
348
|
interface TfliteEventMessages {
|
|
@@ -298,9 +379,23 @@ interface TfliteInference {
|
|
|
298
379
|
values: number[];
|
|
299
380
|
maxValue?: number;
|
|
300
381
|
maxIndex?: number;
|
|
382
|
+
maxClass?: string;
|
|
383
|
+
classValues?: {
|
|
384
|
+
[key: string]: number;
|
|
385
|
+
};
|
|
301
386
|
}
|
|
302
|
-
declare const TfliteSensorTypes:
|
|
387
|
+
declare const TfliteSensorTypes: readonly ["pressure", "linearAcceleration", "gyroscope", "magnetometer"];
|
|
303
388
|
type TfliteSensorType = (typeof TfliteSensorTypes)[number];
|
|
389
|
+
interface TfliteFileConfiguration extends FileConfiguration {
|
|
390
|
+
type: "tflite";
|
|
391
|
+
name: string;
|
|
392
|
+
sensorTypes: TfliteSensorType[];
|
|
393
|
+
task: TfliteTask;
|
|
394
|
+
sampleRate: number;
|
|
395
|
+
captureDelay?: number;
|
|
396
|
+
threshold?: number;
|
|
397
|
+
classes?: string[];
|
|
398
|
+
}
|
|
304
399
|
|
|
305
400
|
interface PnpId {
|
|
306
401
|
source: "Bluetooth" | "USB";
|
|
@@ -344,8 +439,32 @@ interface DeviceInformationEventMessages {
|
|
|
344
439
|
};
|
|
345
440
|
}
|
|
346
441
|
|
|
347
|
-
declare const ConnectionTypes: readonly ["webBluetooth", "noble", "client"];
|
|
442
|
+
declare const ConnectionTypes: readonly ["webBluetooth", "noble", "client", "webSocket", "udp"];
|
|
348
443
|
type ConnectionType = (typeof ConnectionTypes)[number];
|
|
444
|
+
declare const ClientConnectionTypes: readonly ["noble", "webSocket", "udp"];
|
|
445
|
+
type ClientConnectionType = (typeof ClientConnectionTypes)[number];
|
|
446
|
+
interface BaseConnectOptions {
|
|
447
|
+
type: "client" | "webBluetooth" | "webSocket" | "udp";
|
|
448
|
+
}
|
|
449
|
+
interface WebBluetoothConnectOptions extends BaseConnectOptions {
|
|
450
|
+
type: "webBluetooth";
|
|
451
|
+
}
|
|
452
|
+
interface BaseWifiConnectOptions extends BaseConnectOptions {
|
|
453
|
+
ipAddress: string;
|
|
454
|
+
}
|
|
455
|
+
interface ClientConnectOptions extends BaseConnectOptions {
|
|
456
|
+
type: "client";
|
|
457
|
+
subType?: "noble" | "webSocket" | "udp";
|
|
458
|
+
}
|
|
459
|
+
interface WebSocketConnectOptions extends BaseWifiConnectOptions {
|
|
460
|
+
type: "webSocket";
|
|
461
|
+
isWifiSecure?: boolean;
|
|
462
|
+
}
|
|
463
|
+
interface UDPConnectOptions extends BaseWifiConnectOptions {
|
|
464
|
+
type: "udp";
|
|
465
|
+
receivePort?: number;
|
|
466
|
+
}
|
|
467
|
+
type ConnectOptions = WebBluetoothConnectOptions | WebSocketConnectOptions | UDPConnectOptions | ClientConnectOptions;
|
|
349
468
|
declare const ConnectionStatuses: readonly ["notConnected", "connecting", "connected", "disconnecting"];
|
|
350
469
|
type ConnectionStatus = (typeof ConnectionStatuses)[number];
|
|
351
470
|
interface ConnectionStatusEventMessages {
|
|
@@ -364,9 +483,9 @@ interface TxMessage {
|
|
|
364
483
|
type: TxRxMessageType;
|
|
365
484
|
data?: ArrayBuffer;
|
|
366
485
|
}
|
|
367
|
-
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", "
|
|
486
|
+
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"];
|
|
368
487
|
type TxRxMessageType = (typeof TxRxMessageTypes)[number];
|
|
369
|
-
declare const ConnectionMessageTypes: readonly ["batteryLevel", "manufacturerName", "modelNumber", "
|
|
488
|
+
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"];
|
|
370
489
|
type ConnectionMessageType = (typeof ConnectionMessageTypes)[number];
|
|
371
490
|
type ConnectionStatusCallback = (status: ConnectionStatus) => void;
|
|
372
491
|
type MessageReceivedCallback = (messageType: ConnectionMessageType, dataView: DataView) => void;
|
|
@@ -380,22 +499,32 @@ declare abstract class BaseConnectionManager {
|
|
|
380
499
|
protected get baseConstructor(): typeof BaseConnectionManager;
|
|
381
500
|
static get isSupported(): boolean;
|
|
382
501
|
get isSupported(): boolean;
|
|
502
|
+
get canUpdateFirmware(): boolean;
|
|
383
503
|
static type: ConnectionType;
|
|
384
504
|
get type(): ConnectionType;
|
|
385
505
|
constructor();
|
|
386
506
|
get status(): "notConnected" | "connecting" | "connected" | "disconnecting";
|
|
387
507
|
protected set status(newConnectionStatus: "notConnected" | "connecting" | "connected" | "disconnecting");
|
|
388
508
|
get isConnected(): boolean;
|
|
509
|
+
get isAvailable(): boolean;
|
|
510
|
+
/** @throws {Error} if connected */
|
|
511
|
+
protected assertIsNotConnected(): void;
|
|
512
|
+
/** @throws {Error} if not connected */
|
|
513
|
+
protected assertIsConnected(): void;
|
|
514
|
+
/** @throws {Error} if not connected or is disconnecting */
|
|
515
|
+
assertIsConnectedAndNotDisconnecting(): void;
|
|
389
516
|
connect(): Promise<void>;
|
|
390
517
|
get canReconnect(): boolean;
|
|
391
518
|
reconnect(): Promise<void>;
|
|
392
519
|
disconnect(): Promise<void>;
|
|
393
520
|
sendSmpMessage(data: ArrayBuffer): Promise<void>;
|
|
394
521
|
sendTxMessages(messages: TxMessage[] | undefined, sendImmediately?: boolean): Promise<void>;
|
|
522
|
+
protected defaultMtu: number;
|
|
395
523
|
mtu?: number;
|
|
396
524
|
sendTxData(data: ArrayBuffer): Promise<void>;
|
|
397
525
|
parseRxMessage(dataView: DataView): void;
|
|
398
526
|
clear(): void;
|
|
527
|
+
remove(): void;
|
|
399
528
|
}
|
|
400
529
|
|
|
401
530
|
type SensorConfiguration = {
|
|
@@ -446,46 +575,10 @@ interface VibrationWaveformConfiguration extends BaseVibrationConfiguration {
|
|
|
446
575
|
}
|
|
447
576
|
type VibrationConfiguration = VibrationWaveformEffectConfiguration | VibrationWaveformConfiguration;
|
|
448
577
|
|
|
449
|
-
declare const
|
|
450
|
-
type FileType = (typeof FileTypes)[number];
|
|
451
|
-
declare const FileTransferStatuses: readonly ["idle", "sending", "receiving"];
|
|
452
|
-
type FileTransferStatus = (typeof FileTransferStatuses)[number];
|
|
453
|
-
declare const FileTransferDirections: readonly ["sending", "receiving"];
|
|
454
|
-
type FileTransferDirection = (typeof FileTransferDirections)[number];
|
|
455
|
-
interface FileTransferEventMessages {
|
|
456
|
-
maxFileLength: {
|
|
457
|
-
maxFileLength: number;
|
|
458
|
-
};
|
|
459
|
-
getFileType: {
|
|
460
|
-
fileType: FileType;
|
|
461
|
-
};
|
|
462
|
-
getFileLength: {
|
|
463
|
-
fileLength: number;
|
|
464
|
-
};
|
|
465
|
-
getFileChecksum: {
|
|
466
|
-
fileChecksum: number;
|
|
467
|
-
};
|
|
468
|
-
fileTransferStatus: {
|
|
469
|
-
fileTransferStatus: FileTransferStatus;
|
|
470
|
-
};
|
|
471
|
-
getFileBlock: {
|
|
472
|
-
fileTransferBlock: DataView;
|
|
473
|
-
};
|
|
474
|
-
fileTransferProgress: {
|
|
475
|
-
progress: number;
|
|
476
|
-
};
|
|
477
|
-
fileTransferComplete: {
|
|
478
|
-
direction: FileTransferDirection;
|
|
479
|
-
};
|
|
480
|
-
fileReceived: {
|
|
481
|
-
file: File | Blob;
|
|
482
|
-
};
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
declare const DeviceTypes: readonly ["leftInsole", "rightInsole"];
|
|
578
|
+
declare const DeviceTypes: readonly ["leftInsole", "rightInsole", "leftGlove", "rightGlove", "glasses", "generic"];
|
|
486
579
|
type DeviceType = (typeof DeviceTypes)[number];
|
|
487
|
-
declare const
|
|
488
|
-
type
|
|
580
|
+
declare const Sides: readonly ["left", "right"];
|
|
581
|
+
type Side = (typeof Sides)[number];
|
|
489
582
|
declare const MinNameLength = 2;
|
|
490
583
|
declare const MaxNameLength = 30;
|
|
491
584
|
declare const InformationMessageTypes: readonly ["isCharging", "getBatteryCurrent", "getMtu", "getId", "getName", "setName", "getType", "setType", "getCurrentTime", "setCurrentTime"];
|
|
@@ -534,21 +627,48 @@ declare class InformationManager {
|
|
|
534
627
|
get name(): string;
|
|
535
628
|
updateName(updatedName: string): void;
|
|
536
629
|
setName(newName: string): Promise<void>;
|
|
537
|
-
get type(): "leftInsole" | "rightInsole";
|
|
630
|
+
get type(): "leftInsole" | "rightInsole" | "leftGlove" | "rightGlove" | "glasses" | "generic";
|
|
538
631
|
get typeEnum(): number;
|
|
539
632
|
updateType(updatedType: DeviceType): void;
|
|
540
633
|
setType(newType: DeviceType): Promise<void>;
|
|
541
634
|
get isInsole(): boolean;
|
|
542
|
-
get
|
|
635
|
+
get isGlove(): boolean;
|
|
636
|
+
get side(): Side;
|
|
543
637
|
get mtu(): number;
|
|
544
638
|
get isCurrentTimeSet(): boolean;
|
|
545
639
|
parseMessage(messageType: InformationMessageType, dataView: DataView): void;
|
|
546
640
|
clear(): void;
|
|
641
|
+
connectionType?: ConnectionType;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
declare const MinWifiSSIDLength = 1;
|
|
645
|
+
declare const MaxWifiSSIDLength = 32;
|
|
646
|
+
declare const MinWifiPasswordLength = 8;
|
|
647
|
+
declare const MaxWifiPasswordLength = 64;
|
|
648
|
+
interface WifiEventMessages {
|
|
649
|
+
isWifiAvailable: {
|
|
650
|
+
isWifiAvailable: boolean;
|
|
651
|
+
};
|
|
652
|
+
getWifiSSID: {
|
|
653
|
+
wifiSSID: string;
|
|
654
|
+
};
|
|
655
|
+
getWifiPassword: {
|
|
656
|
+
wifiPassword: string;
|
|
657
|
+
};
|
|
658
|
+
getEnableWifiConnection: {
|
|
659
|
+
wifiConnectionEnabled: boolean;
|
|
660
|
+
};
|
|
661
|
+
isWifiConnected: {
|
|
662
|
+
isWifiConnected: boolean;
|
|
663
|
+
};
|
|
664
|
+
ipAddress: {
|
|
665
|
+
ipAddress?: string;
|
|
666
|
+
};
|
|
547
667
|
}
|
|
548
668
|
|
|
549
|
-
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", "
|
|
669
|
+
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"];
|
|
550
670
|
type DeviceEventType = (typeof DeviceEventTypes)[number];
|
|
551
|
-
interface DeviceEventMessages extends ConnectionStatusEventMessages, DeviceInformationEventMessages, InformationEventMessages, SensorDataEventMessages, SensorConfigurationEventMessages, TfliteEventMessages, FileTransferEventMessages, FirmwareEventMessages {
|
|
671
|
+
interface DeviceEventMessages extends ConnectionStatusEventMessages, DeviceInformationEventMessages, InformationEventMessages, SensorDataEventMessages, SensorConfigurationEventMessages, TfliteEventMessages, FileTransferEventMessages, WifiEventMessages, CameraEventMessages, FirmwareEventMessages {
|
|
552
672
|
batteryLevel: {
|
|
553
673
|
batteryLevel: number;
|
|
554
674
|
};
|
|
@@ -568,30 +688,31 @@ type BoundDeviceEventListeners = BoundEventListeners<Device, DeviceEventType, De
|
|
|
568
688
|
declare class Device {
|
|
569
689
|
#private;
|
|
570
690
|
get bluetoothId(): string | undefined;
|
|
691
|
+
get isAvailable(): boolean | undefined;
|
|
571
692
|
constructor();
|
|
572
|
-
get addEventListener(): <T extends "maxFileLength" | "getFileType" | "setFileType" | "getFileLength" | "setFileLength" | "getFileChecksum" | "setFileChecksum" | "setFileTransferCommand" | "fileTransferStatus" | "getFileBlock" | "setFileBlock" | "fileBytesTransferred" | "fileTransferProgress" | "fileTransferComplete" | "fileReceived" | "
|
|
693
|
+
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: {
|
|
573
694
|
type: T;
|
|
574
695
|
target: Device;
|
|
575
696
|
message: DeviceEventMessages[T];
|
|
576
697
|
}) => void, options?: {
|
|
577
698
|
once?: boolean;
|
|
578
699
|
}) => void;
|
|
579
|
-
get removeEventListener(): <T extends "maxFileLength" | "getFileType" | "setFileType" | "getFileLength" | "setFileLength" | "getFileChecksum" | "setFileChecksum" | "setFileTransferCommand" | "fileTransferStatus" | "getFileBlock" | "setFileBlock" | "fileBytesTransferred" | "fileTransferProgress" | "fileTransferComplete" | "fileReceived" | "
|
|
700
|
+
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: {
|
|
580
701
|
type: T;
|
|
581
702
|
target: Device;
|
|
582
703
|
message: DeviceEventMessages[T];
|
|
583
704
|
}) => void) => void;
|
|
584
|
-
get waitForEvent(): <T extends "maxFileLength" | "getFileType" | "setFileType" | "getFileLength" | "setFileLength" | "getFileChecksum" | "setFileChecksum" | "setFileTransferCommand" | "fileTransferStatus" | "getFileBlock" | "setFileBlock" | "fileBytesTransferred" | "fileTransferProgress" | "fileTransferComplete" | "fileReceived" | "
|
|
705
|
+
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<{
|
|
585
706
|
type: T;
|
|
586
707
|
target: Device;
|
|
587
708
|
message: DeviceEventMessages[T];
|
|
588
709
|
}>;
|
|
589
|
-
get removeEventListeners(): <T extends "maxFileLength" | "getFileType" | "setFileType" | "getFileLength" | "setFileLength" | "getFileChecksum" | "setFileChecksum" | "setFileTransferCommand" | "fileTransferStatus" | "getFileBlock" | "setFileBlock" | "fileBytesTransferred" | "fileTransferProgress" | "fileTransferComplete" | "fileReceived" | "
|
|
710
|
+
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;
|
|
590
711
|
get removeAllEventListeners(): () => void;
|
|
591
712
|
get connectionManager(): BaseConnectionManager | undefined;
|
|
592
713
|
set connectionManager(newConnectionManager: BaseConnectionManager | undefined);
|
|
593
714
|
private sendTxMessages;
|
|
594
|
-
connect(): Promise<void>;
|
|
715
|
+
connect(options?: ConnectOptions): Promise<void>;
|
|
595
716
|
get isConnected(): boolean;
|
|
596
717
|
get canReconnect(): boolean | undefined;
|
|
597
718
|
reconnect(): Promise<void | undefined>;
|
|
@@ -600,12 +721,12 @@ declare class Device {
|
|
|
600
721
|
static set ReconnectOnDisconnection(newReconnectOnDisconnection: boolean);
|
|
601
722
|
get reconnectOnDisconnection(): boolean;
|
|
602
723
|
set reconnectOnDisconnection(newReconnectOnDisconnection: boolean);
|
|
603
|
-
get connectionType(): "webBluetooth" | "noble" | "client" | undefined;
|
|
724
|
+
get connectionType(): "webBluetooth" | "noble" | "client" | "webSocket" | "udp" | undefined;
|
|
604
725
|
disconnect(): Promise<void>;
|
|
605
726
|
toggleConnection(): void;
|
|
606
727
|
get connectionStatus(): ConnectionStatus;
|
|
607
728
|
get isConnectionBusy(): boolean;
|
|
608
|
-
|
|
729
|
+
latestConnectionMessages: Map<ConnectionMessageType, DataView>;
|
|
609
730
|
get deviceInformation(): DeviceInformation;
|
|
610
731
|
get batteryLevel(): number;
|
|
611
732
|
/** @private */
|
|
@@ -616,13 +737,14 @@ declare class Device {
|
|
|
616
737
|
get getBatteryCurrent(): () => Promise<void>;
|
|
617
738
|
get name(): string;
|
|
618
739
|
get setName(): (newName: string) => Promise<void>;
|
|
619
|
-
get type(): "leftInsole" | "rightInsole";
|
|
740
|
+
get type(): "leftInsole" | "rightInsole" | "leftGlove" | "rightGlove" | "glasses" | "generic";
|
|
620
741
|
get setType(): (newType: DeviceType) => Promise<void>;
|
|
621
742
|
get isInsole(): boolean;
|
|
622
|
-
get
|
|
743
|
+
get isGlove(): boolean;
|
|
744
|
+
get side(): "left" | "right";
|
|
623
745
|
get mtu(): number;
|
|
624
746
|
get sensorTypes(): SensorType[];
|
|
625
|
-
get continuousSensorTypes(): ("pressure" | "acceleration" | "gravity" | "linearAcceleration" | "gyroscope" | "magnetometer" | "gameRotation" | "rotation" | "barometer")[];
|
|
747
|
+
get continuousSensorTypes(): ("pressure" | "acceleration" | "gravity" | "linearAcceleration" | "gyroscope" | "magnetometer" | "gameRotation" | "rotation" | "orientation" | "barometer")[];
|
|
626
748
|
get sensorConfiguration(): SensorConfiguration;
|
|
627
749
|
setSensorConfiguration(newSensorConfiguration: SensorConfiguration, clearRest?: boolean): Promise<void>;
|
|
628
750
|
clearSensorConfiguration(): Promise<void>;
|
|
@@ -632,20 +754,24 @@ declare class Device {
|
|
|
632
754
|
set clearSensorConfigurationOnLeave(newClearSensorConfigurationOnLeave: boolean);
|
|
633
755
|
get numberOfPressureSensors(): number;
|
|
634
756
|
resetPressureRange(): void;
|
|
757
|
+
get vibrationLocations(): ("front" | "rear")[];
|
|
635
758
|
triggerVibration(vibrationConfigurations: VibrationConfiguration[], sendImmediately?: boolean): Promise<void>;
|
|
759
|
+
get fileTypes(): ("tflite" | "wifiServerCert" | "wifiServerKey")[];
|
|
636
760
|
get maxFileLength(): number;
|
|
761
|
+
get validFileTypes(): ("tflite" | "wifiServerCert" | "wifiServerKey")[];
|
|
637
762
|
sendFile(fileType: FileType, file: FileLike): Promise<void>;
|
|
638
763
|
receiveFile(fileType: FileType): Promise<void>;
|
|
639
764
|
get fileTransferStatus(): "idle" | "sending" | "receiving";
|
|
640
765
|
cancelFileTransfer(): void;
|
|
641
766
|
get tfliteName(): string;
|
|
642
767
|
get setTfliteName(): (newName: string, sendImmediately?: boolean) => Promise<void>;
|
|
768
|
+
sendTfliteConfiguration(configuration: TfliteFileConfiguration): Promise<void>;
|
|
643
769
|
get tfliteTask(): "classification" | "regression";
|
|
644
770
|
get setTfliteTask(): (newTask: TfliteTask, sendImmediately?: boolean) => Promise<void>;
|
|
645
771
|
get tfliteSampleRate(): number;
|
|
646
772
|
get setTfliteSampleRate(): (newSampleRate: number, sendImmediately?: boolean) => Promise<void>;
|
|
647
|
-
get tfliteSensorTypes(): ("pressure" | "
|
|
648
|
-
get allowedTfliteSensorTypes(): ("pressure" | "acceleration" | "gravity" | "linearAcceleration" | "gyroscope" | "magnetometer" | "gameRotation" | "rotation" | "orientation" | "activity" | "stepCounter" | "stepDetector" | "deviceOrientation" | "barometer")[];
|
|
773
|
+
get tfliteSensorTypes(): ("pressure" | "linearAcceleration" | "gyroscope" | "magnetometer")[];
|
|
774
|
+
get allowedTfliteSensorTypes(): ("pressure" | "acceleration" | "gravity" | "linearAcceleration" | "gyroscope" | "magnetometer" | "gameRotation" | "rotation" | "orientation" | "activity" | "stepCounter" | "stepDetector" | "deviceOrientation" | "tapDetector" | "barometer" | "camera")[];
|
|
649
775
|
get setTfliteSensorTypes(): (newSensorTypes: SensorType[], sendImmediately?: boolean) => Promise<void>;
|
|
650
776
|
get tfliteIsReady(): boolean;
|
|
651
777
|
get tfliteInferencingEnabled(): boolean;
|
|
@@ -657,8 +783,10 @@ declare class Device {
|
|
|
657
783
|
get setTfliteCaptureDelay(): (newCaptureDelay: number, sendImmediately: boolean) => Promise<void>;
|
|
658
784
|
get tfliteThreshold(): number;
|
|
659
785
|
get setTfliteThreshold(): (newThreshold: number, sendImmediately: boolean) => Promise<void>;
|
|
786
|
+
get canUpdateFirmware(): boolean | undefined;
|
|
660
787
|
private sendSmpMessage;
|
|
661
788
|
get uploadFirmware(): (file: FileLike) => Promise<void>;
|
|
789
|
+
get canReset(): boolean | undefined;
|
|
662
790
|
reset(): Promise<void>;
|
|
663
791
|
get firmwareStatus(): "idle" | "uploading" | "uploaded" | "pending" | "testing" | "erasing";
|
|
664
792
|
get getFirmwareImages(): () => Promise<void>;
|
|
@@ -668,6 +796,33 @@ declare class Device {
|
|
|
668
796
|
get testFirmwareImage(): (imageIndex?: number) => Promise<void>;
|
|
669
797
|
get isServerSide(): boolean;
|
|
670
798
|
set isServerSide(newIsServerSide: boolean);
|
|
799
|
+
get isUkaton(): boolean;
|
|
800
|
+
get isWifiAvailable(): boolean;
|
|
801
|
+
get wifiSSID(): string;
|
|
802
|
+
setWifiSSID(newWifiSSID: string): Promise<void>;
|
|
803
|
+
get wifiPassword(): string;
|
|
804
|
+
setWifiPassword(newWifiPassword: string): Promise<void>;
|
|
805
|
+
get isWifiConnected(): boolean;
|
|
806
|
+
get ipAddress(): string | undefined;
|
|
807
|
+
get wifiConnectionEnabled(): boolean;
|
|
808
|
+
get enableWifiConnection(): () => Promise<void>;
|
|
809
|
+
get setWifiConnectionEnabled(): (newWifiConnectionEnabled: boolean, sendImmediately?: boolean) => Promise<void>;
|
|
810
|
+
get disableWifiConnection(): () => Promise<void>;
|
|
811
|
+
get toggleWifiConnection(): () => Promise<void>;
|
|
812
|
+
get isWifiSecure(): boolean;
|
|
813
|
+
reconnectViaWebSockets(): Promise<void>;
|
|
814
|
+
reconnectViaUDP(): Promise<void>;
|
|
815
|
+
get hasCamera(): boolean;
|
|
816
|
+
get cameraStatus(): "idle" | "focusing" | "takingPicture" | "asleep";
|
|
817
|
+
takePicture(): Promise<void>;
|
|
818
|
+
focusCamera(): Promise<void>;
|
|
819
|
+
stopCamera(): Promise<void>;
|
|
820
|
+
wakeCamera(): Promise<void>;
|
|
821
|
+
sleepCamera(): Promise<void>;
|
|
822
|
+
get cameraConfiguration(): CameraConfiguration;
|
|
823
|
+
get availableCameraConfigurationTypes(): ("resolution" | "qualityFactor" | "shutter" | "gain" | "redGain" | "greenGain" | "blueGain")[];
|
|
824
|
+
get cameraConfigurationRanges(): CameraConfigurationRanges;
|
|
825
|
+
get setCameraConfiguration(): (newCameraConfiguration: CameraConfiguration) => Promise<void>;
|
|
671
826
|
}
|
|
672
827
|
|
|
673
828
|
declare const DeviceManagerEventTypes: readonly ["deviceConnected", "deviceDisconnected", "deviceIsConnected", "availableDevices", "connectedDevices"];
|
|
@@ -724,11 +879,15 @@ declare class DeviceManager {
|
|
|
724
879
|
}) => void) => void;
|
|
725
880
|
get RemoveEventListeners(): <T extends "deviceConnected" | "deviceDisconnected" | "deviceIsConnected" | "availableDevices" | "connectedDevices">(type: T) => void;
|
|
726
881
|
get RemoveAllEventListeners(): () => void;
|
|
882
|
+
_CheckDeviceAvailability(device: Device): void;
|
|
727
883
|
}
|
|
728
884
|
declare const _default: DeviceManager;
|
|
729
885
|
|
|
730
886
|
interface DevicePairPressureData {
|
|
731
|
-
|
|
887
|
+
sensors: {
|
|
888
|
+
[key in Side]: PressureSensorValue[];
|
|
889
|
+
};
|
|
890
|
+
scaledSum: number;
|
|
732
891
|
normalizedSum: number;
|
|
733
892
|
center?: CenterOfPressure;
|
|
734
893
|
normalizedCenter?: CenterOfPressure;
|
|
@@ -741,7 +900,7 @@ interface DevicePairPressureDataEventMessages {
|
|
|
741
900
|
}
|
|
742
901
|
|
|
743
902
|
type DevicePairSensorDataTimestamps = {
|
|
744
|
-
[
|
|
903
|
+
[side in Side]: number;
|
|
745
904
|
};
|
|
746
905
|
interface BaseDevicePairSensorDataEventMessage {
|
|
747
906
|
timestamps: DevicePairSensorDataTimestamps;
|
|
@@ -756,7 +915,7 @@ type DevicePairSensorDataEventMessages = _DevicePairSensorDataEventMessages & An
|
|
|
756
915
|
|
|
757
916
|
interface BaseDevicePairDeviceEventMessage {
|
|
758
917
|
device: Device;
|
|
759
|
-
side:
|
|
918
|
+
side: Side;
|
|
760
919
|
}
|
|
761
920
|
type DevicePairDeviceEventMessages = ExtendInterfaceValues<AddPrefixToInterfaceKeys<DeviceEventMessages, "device">, BaseDevicePairDeviceEventMessage>;
|
|
762
921
|
interface DevicePairConnectionEventMessages {
|
|
@@ -769,46 +928,61 @@ type DevicePairEventMap = EventMap<DevicePair, DeviceEventType, DevicePairEventM
|
|
|
769
928
|
type DevicePairEventListenerMap = EventListenerMap<DevicePair, DeviceEventType, DevicePairEventMessages>;
|
|
770
929
|
type DevicePairEvent = Event<DevicePair, DeviceEventType, DevicePairEventMessages>;
|
|
771
930
|
type BoundDevicePairEventListeners = BoundEventListeners<DevicePair, DeviceEventType, DevicePairEventMessages>;
|
|
931
|
+
declare const DevicePairTypes: readonly ["insoles", "gloves"];
|
|
932
|
+
type DevicePairType = (typeof DevicePairTypes)[number];
|
|
772
933
|
declare class DevicePair {
|
|
773
934
|
#private;
|
|
774
|
-
constructor();
|
|
935
|
+
constructor(type: DevicePairType);
|
|
775
936
|
get sides(): readonly ["left", "right"];
|
|
776
|
-
get
|
|
937
|
+
get type(): "insoles" | "gloves";
|
|
938
|
+
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: {
|
|
777
939
|
type: T;
|
|
778
940
|
target: DevicePair;
|
|
779
941
|
message: DevicePairEventMessages[T];
|
|
780
942
|
}) => void, options?: {
|
|
781
943
|
once?: boolean;
|
|
782
944
|
}) => void;
|
|
783
|
-
get removeEventListener(): <T extends "pressure" | "deviceOrientation" | "sensorData" | "isConnected" | "deviceConnected" | "deviceIsConnected" | "deviceMaxFileLength" | "deviceGetFileType" | "deviceGetFileLength" | "deviceGetFileChecksum" | "deviceFileTransferStatus" | "deviceGetFileBlock" | "deviceFileTransferProgress" | "deviceFileTransferComplete" | "deviceFileReceived" | "
|
|
945
|
+
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: {
|
|
784
946
|
type: T;
|
|
785
947
|
target: DevicePair;
|
|
786
948
|
message: DevicePairEventMessages[T];
|
|
787
949
|
}) => void) => void;
|
|
788
|
-
get waitForEvent(): <T extends "pressure" | "deviceOrientation" | "sensorData" | "isConnected" | "deviceConnected" | "deviceIsConnected" | "deviceMaxFileLength" | "deviceGetFileType" | "deviceGetFileLength" | "deviceGetFileChecksum" | "deviceFileTransferStatus" | "deviceGetFileBlock" | "deviceFileTransferProgress" | "deviceFileTransferComplete" | "deviceFileReceived" | "
|
|
950
|
+
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<{
|
|
789
951
|
type: T;
|
|
790
952
|
target: DevicePair;
|
|
791
953
|
message: DevicePairEventMessages[T];
|
|
792
954
|
}>;
|
|
793
|
-
get removeEventListeners(): <T extends "pressure" | "deviceOrientation" | "sensorData" | "isConnected" | "deviceConnected" | "deviceIsConnected" | "deviceMaxFileLength" | "deviceGetFileType" | "deviceGetFileLength" | "deviceGetFileChecksum" | "deviceFileTransferStatus" | "deviceGetFileBlock" | "deviceFileTransferProgress" | "deviceFileTransferComplete" | "deviceFileReceived" | "
|
|
955
|
+
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;
|
|
794
956
|
get removeAllEventListeners(): () => void;
|
|
795
957
|
get left(): Device | undefined;
|
|
796
958
|
get right(): Device | undefined;
|
|
797
959
|
get isConnected(): boolean;
|
|
798
960
|
get isPartiallyConnected(): boolean;
|
|
799
961
|
get isHalfConnected(): boolean;
|
|
800
|
-
|
|
962
|
+
assignDevice(device: Device): Device | undefined;
|
|
801
963
|
setSensorConfiguration(sensorConfiguration: SensorConfiguration): Promise<void>;
|
|
802
964
|
resetPressureRange(): void;
|
|
803
965
|
triggerVibration(vibrationConfigurations: VibrationConfiguration[], sendImmediately?: boolean): Promise<PromiseSettledResult<void | undefined>[]>;
|
|
804
|
-
static get
|
|
966
|
+
static get insoles(): DevicePair;
|
|
967
|
+
static get gloves(): DevicePair;
|
|
805
968
|
}
|
|
806
969
|
|
|
970
|
+
type BoundGenericEventListeners = {
|
|
971
|
+
[eventType: string]: Function;
|
|
972
|
+
};
|
|
973
|
+
declare function addEventListeners(target: any, boundEventListeners: BoundGenericEventListeners): void;
|
|
974
|
+
declare function removeEventListeners(target: any, boundEventListeners: BoundGenericEventListeners): void;
|
|
975
|
+
|
|
976
|
+
declare function throttle<T extends (...args: any[]) => void>(fn: T, interval: number, trailing?: boolean): (...args: Parameters<T>) => void;
|
|
977
|
+
declare function debounce<T extends (...args: any[]) => void>(fn: T, interval: number, callImmediately?: boolean): (...args: Parameters<T>) => void;
|
|
978
|
+
|
|
807
979
|
interface DiscoveredDevice {
|
|
808
980
|
bluetoothId: string;
|
|
809
981
|
name: string;
|
|
810
982
|
deviceType: DeviceType;
|
|
811
983
|
rssi: number;
|
|
984
|
+
ipAddress?: string;
|
|
985
|
+
isWifiSecure?: boolean;
|
|
812
986
|
}
|
|
813
987
|
interface ScannerDiscoveredDeviceEventMessage {
|
|
814
988
|
discoveredDevice: DiscoveredDevice;
|
|
@@ -827,7 +1001,7 @@ type DiscoveredDevicesMap = {
|
|
|
827
1001
|
[deviceId: string]: DiscoveredDevice;
|
|
828
1002
|
};
|
|
829
1003
|
|
|
830
|
-
declare const ServerMessageTypes: readonly ["isScanningAvailable", "isScanning", "startScan", "stopScan", "discoveredDevice", "discoveredDevices", "expiredDiscoveredDevice", "connectToDevice", "disconnectFromDevice", "connectedDevices", "deviceMessage"];
|
|
1004
|
+
declare const ServerMessageTypes: readonly ["isScanningAvailable", "isScanning", "startScan", "stopScan", "discoveredDevice", "discoveredDevices", "expiredDiscoveredDevice", "connectToDevice", "disconnectFromDevice", "connectedDevices", "deviceMessage", "requiredDeviceInformation"];
|
|
831
1005
|
type ServerMessageType = (typeof ServerMessageTypes)[number];
|
|
832
1006
|
type MessageLike = number | number[] | ArrayBufferLike | DataView | boolean | string | any;
|
|
833
1007
|
interface Message<MessageType extends string> {
|
|
@@ -892,6 +1066,7 @@ declare abstract class BaseClient {
|
|
|
892
1066
|
protected get _connectionStatus(): "notConnected" | "connecting" | "connected" | "disconnecting";
|
|
893
1067
|
protected set _connectionStatus(newConnectionStatus: "notConnected" | "connecting" | "connected" | "disconnecting");
|
|
894
1068
|
get connectionStatus(): "notConnected" | "connecting" | "connected" | "disconnecting";
|
|
1069
|
+
protected _sendRequiredMessages(): void;
|
|
895
1070
|
protected parseMessage(dataView: DataView): void;
|
|
896
1071
|
get isScanningAvailable(): boolean;
|
|
897
1072
|
protected requestIsScanningAvailable(): void;
|
|
@@ -902,15 +1077,16 @@ declare abstract class BaseClient {
|
|
|
902
1077
|
get discoveredDevices(): Readonly<DiscoveredDevicesMap>;
|
|
903
1078
|
protected onDiscoveredDevice(discoveredDevice: DiscoveredDevice): void;
|
|
904
1079
|
requestDiscoveredDevices(): void;
|
|
905
|
-
connectToDevice(bluetoothId: string): Device;
|
|
906
|
-
protected requestConnectionToDevice(bluetoothId: string): Device;
|
|
907
|
-
protected sendConnectToDeviceMessage(bluetoothId: string): void;
|
|
1080
|
+
connectToDevice(bluetoothId: string, connectionType?: ClientConnectionType): Device;
|
|
1081
|
+
protected requestConnectionToDevice(bluetoothId: string, connectionType?: ClientConnectionType): Device;
|
|
1082
|
+
protected sendConnectToDeviceMessage(bluetoothId: string, connectionType?: ClientConnectionType): void;
|
|
908
1083
|
createDevice(bluetoothId: string): Device;
|
|
909
1084
|
protected onConnectedBluetoothDeviceIds(bluetoothIds: string[]): void;
|
|
910
1085
|
disconnectFromDevice(bluetoothId: string): void;
|
|
911
1086
|
protected requestDisconnectionFromDevice(bluetoothId: string): Device;
|
|
912
1087
|
protected sendDisconnectFromDeviceMessage(bluetoothId: string): void;
|
|
913
1088
|
protected sendDeviceMessage(bluetoothId: string, ...messages: ClientDeviceMessage[]): void;
|
|
1089
|
+
protected sendRequiredDeviceInformationMessage(bluetoothId: string): void;
|
|
914
1090
|
}
|
|
915
1091
|
|
|
916
1092
|
declare class WebSocketClient extends BaseClient {
|
|
@@ -928,4 +1104,14 @@ declare class WebSocketClient extends BaseClient {
|
|
|
928
1104
|
sendServerMessage(...messages: ServerMessage[]): void;
|
|
929
1105
|
}
|
|
930
1106
|
|
|
931
|
-
|
|
1107
|
+
declare const EventUtils: {
|
|
1108
|
+
addEventListeners: typeof addEventListeners;
|
|
1109
|
+
removeEventListeners: typeof removeEventListeners;
|
|
1110
|
+
};
|
|
1111
|
+
|
|
1112
|
+
declare const ThrottleUtils: {
|
|
1113
|
+
throttle: typeof throttle;
|
|
1114
|
+
debounce: typeof debounce;
|
|
1115
|
+
};
|
|
1116
|
+
|
|
1117
|
+
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, type SensorConfiguration, SensorRateStep, type SensorType, SensorTypes, type Side, Sides, type TfliteFileConfiguration, type TfliteSensorType, TfliteSensorTypes, type TfliteTask, TfliteTasks, ThrottleUtils, type Vector2, type Vector3, type VibrationConfiguration, type VibrationLocation, VibrationLocations, type VibrationType, VibrationTypes, type VibrationWaveformEffect, VibrationWaveformEffects, WebSocketClient, setAllConsoleLevelFlags, setConsoleLevelFlagsForType };
|