brilliantsole 0.0.1
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/LICENSE +21 -0
- package/README.md +21 -0
- package/build/brilliantsole.cjs +5957 -0
- package/build/brilliantsole.cjs.map +1 -0
- package/build/brilliantsole.js +5448 -0
- package/build/brilliantsole.js.map +1 -0
- package/build/brilliantsole.ls.js +4872 -0
- package/build/brilliantsole.ls.js.map +1 -0
- package/build/brilliantsole.min.js +6 -0
- package/build/brilliantsole.min.js.map +1 -0
- package/build/brilliantsole.module.d.ts +908 -0
- package/build/brilliantsole.module.js +5412 -0
- package/build/brilliantsole.module.js.map +1 -0
- package/build/brilliantsole.module.min.d.ts +908 -0
- package/build/brilliantsole.module.min.js +6 -0
- package/build/brilliantsole.module.min.js.map +1 -0
- package/build/brilliantsole.node.module.d.ts +908 -0
- package/build/brilliantsole.node.module.js +5906 -0
- package/build/brilliantsole.node.module.js.map +1 -0
- package/build/dts/BS.d.ts +25 -0
- package/build/dts/Device.d.ts +136 -0
- package/build/dts/DeviceInformationManager.d.ts +56 -0
- package/build/dts/DeviceManager.d.ts +67 -0
- package/build/dts/FileTransferManager.d.ts +84 -0
- package/build/dts/FirmwareManager.d.ts +71 -0
- package/build/dts/InformationManager.d.ts +66 -0
- package/build/dts/TfliteManager.d.ts +92 -0
- package/build/dts/connection/BaseConnectionManager.d.ts +59 -0
- package/build/dts/connection/ClientConnectionManager.d.ts +23 -0
- package/build/dts/connection/WebSocketClientConnectionManager.d.ts +23 -0
- package/build/dts/connection/bluetooth/BluetoothConnectionManager.d.ts +10 -0
- package/build/dts/connection/bluetooth/NobleConnectionManager.d.ts +42 -0
- package/build/dts/connection/bluetooth/WebBluetoothConnectionManager.d.ts +20 -0
- package/build/dts/connection/bluetooth/bluetoothUUIDs.d.ts +14 -0
- package/build/dts/connection/webSocket/ClientConnectionManager.d.ts +23 -0
- package/build/dts/connection/webSocket/WebSocketClientConnectionManager.d.ts +23 -0
- package/build/dts/devicePair/DevicePair.d.ts +60 -0
- package/build/dts/devicePair/DevicePairPressureSensorDataManager.d.ts +25 -0
- package/build/dts/devicePair/DevicePairSensorDataManager.d.ts +33 -0
- package/build/dts/scanner/BaseScanner.d.ts +66 -0
- package/build/dts/scanner/NobleScanner.d.ts +17 -0
- package/build/dts/scanner/Scanner.d.ts +3 -0
- package/build/dts/sensor/BarometerSensorDataManager.d.ts +16 -0
- package/build/dts/sensor/MotionSensorDataManager.d.ts +69 -0
- package/build/dts/sensor/PressureSensorDataManager.d.ts +36 -0
- package/build/dts/sensor/SensorConfigurationManager.d.ts +44 -0
- package/build/dts/sensor/SensorDataManager.d.ts +40 -0
- package/build/dts/server/BaseClient.d.ts +85 -0
- package/build/dts/server/BaseServer.d.ts +48 -0
- package/build/dts/server/ServerUtils.d.ts +23 -0
- package/build/dts/server/udp/UDPServer.d.ts +11 -0
- package/build/dts/server/udp/UDPUtils.d.ts +9 -0
- package/build/dts/server/websocket/WebSocketClient.d.ts +17 -0
- package/build/dts/server/websocket/WebSocketServer.d.ts +13 -0
- package/build/dts/server/websocket/WebSocketUtils.d.ts +9 -0
- package/build/dts/utils/ArrayBufferUtils.d.ts +7 -0
- package/build/dts/utils/ArrayUtils.d.ts +2 -0
- package/build/dts/utils/CenterOfPressureHelper.d.ts +15 -0
- package/build/dts/utils/Console.d.ts +34 -0
- package/build/dts/utils/EventDispatcher.d.ts +50 -0
- package/build/dts/utils/EventUtils.d.ts +6 -0
- package/build/dts/utils/MathUtils.d.ts +21 -0
- package/build/dts/utils/ParseUtils.d.ts +5 -0
- package/build/dts/utils/RangeHelper.d.ts +8 -0
- package/build/dts/utils/Text.d.ts +6 -0
- package/build/dts/utils/Timer.d.ts +14 -0
- package/build/dts/utils/TypeScriptUtils.d.ts +19 -0
- package/build/dts/utils/cbor.d.ts +6 -0
- package/build/dts/utils/checksum.d.ts +3 -0
- package/build/dts/utils/environment.d.ts +13 -0
- package/build/dts/utils/mcumgr.d.ts +88 -0
- package/build/dts/utils/stringUtils.d.ts +2 -0
- package/build/dts/vibration/VibrationManager.d.ts +45 -0
- package/build/dts/vibration/VibrationWaveformEffects.d.ts +2 -0
- package/build/index.d.ts +908 -0
- package/build/index.node.d.ts +908 -0
- package/examples/3d/index.html +109 -0
- package/examples/3d/scene.html +57 -0
- package/examples/3d/script.js +419 -0
- package/examples/balance/index.html +138 -0
- package/examples/balance/script.js +243 -0
- package/examples/basic/index.html +327 -0
- package/examples/basic/script.js +1093 -0
- package/examples/center-of-pressure/index.html +132 -0
- package/examples/center-of-pressure/script.js +207 -0
- package/examples/device-pair/index.html +72 -0
- package/examples/device-pair/script.js +187 -0
- package/examples/edge-impulse/index.html +94 -0
- package/examples/edge-impulse/script.js +1033 -0
- package/examples/graph/index.html +83 -0
- package/examples/graph/script.js +469 -0
- package/examples/machine-learning/index.html +366 -0
- package/examples/machine-learning/script.js +1774 -0
- package/examples/pressure/index.html +145 -0
- package/examples/pressure/script.js +201 -0
- package/examples/recording/index.html +187 -0
- package/examples/recording/script.js +736 -0
- package/examples/server/index.html +266 -0
- package/examples/server/script.js +925 -0
- package/examples/utils/aframe/fingertip-button-component.js +201 -0
- package/examples/utils/aframe/fingertip-collider-target-component.js +102 -0
- package/examples/utils/aframe/fingertip-colliders-component.js +147 -0
- package/examples/utils/three/three.module.min.js +24846 -0
- package/examples/webxr/index.html +221 -0
- package/examples/webxr/script.js +1127 -0
- package/package.json +83 -0
- package/src/BS.ts +68 -0
- package/src/Device.ts +734 -0
- package/src/DeviceInformationManager.ts +146 -0
- package/src/DeviceManager.ts +354 -0
- package/src/FileTransferManager.ts +452 -0
- package/src/FirmwareManager.ts +357 -0
- package/src/InformationManager.ts +283 -0
- package/src/TfliteManager.ts +450 -0
- package/src/connection/BaseConnectionManager.ts +255 -0
- package/src/connection/ClientConnectionManager.ts +120 -0
- package/src/connection/bluetooth/BluetoothConnectionManager.ts +34 -0
- package/src/connection/bluetooth/NobleConnectionManager.ts +302 -0
- package/src/connection/bluetooth/WebBluetoothConnectionManager.ts +269 -0
- package/src/connection/bluetooth/bluetoothUUIDs.ts +218 -0
- package/src/devicePair/DevicePair.ts +253 -0
- package/src/devicePair/DevicePairPressureSensorDataManager.ts +82 -0
- package/src/devicePair/DevicePairSensorDataManager.ts +90 -0
- package/src/scanner/BaseScanner.ts +189 -0
- package/src/scanner/NobleScanner.ts +195 -0
- package/src/scanner/Scanner.ts +16 -0
- package/src/sensor/BarometerSensorDataManager.ts +41 -0
- package/src/sensor/MotionSensorDataManager.ts +151 -0
- package/src/sensor/PressureSensorDataManager.ts +112 -0
- package/src/sensor/SensorConfigurationManager.ts +177 -0
- package/src/sensor/SensorDataManager.ts +166 -0
- package/src/server/BaseClient.ts +368 -0
- package/src/server/BaseServer.ts +344 -0
- package/src/server/ServerUtils.ts +93 -0
- package/src/server/udp/UDPServer.ts +229 -0
- package/src/server/udp/UDPUtils.ts +20 -0
- package/src/server/websocket/WebSocketClient.ts +179 -0
- package/src/server/websocket/WebSocketServer.ts +184 -0
- package/src/server/websocket/WebSocketUtils.ts +20 -0
- package/src/utils/ArrayBufferUtils.ts +88 -0
- package/src/utils/ArrayUtils.ts +15 -0
- package/src/utils/CenterOfPressureHelper.ts +39 -0
- package/src/utils/Console.ts +156 -0
- package/src/utils/EventDispatcher.ts +153 -0
- package/src/utils/EventUtils.ts +41 -0
- package/src/utils/MathUtils.ts +53 -0
- package/src/utils/ParseUtils.ts +46 -0
- package/src/utils/RangeHelper.ts +38 -0
- package/src/utils/Text.ts +30 -0
- package/src/utils/Timer.ts +72 -0
- package/src/utils/TypeScriptUtils.ts +22 -0
- package/src/utils/cbor.js +429 -0
- package/src/utils/checksum.ts +41 -0
- package/src/utils/environment.ts +46 -0
- package/src/utils/mcumgr.js +444 -0
- package/src/utils/stringUtils.ts +11 -0
- package/src/vibration/VibrationManager.ts +308 -0
- package/src/vibration/VibrationWaveformEffects.ts +128 -0
package/src/Device.ts
ADDED
|
@@ -0,0 +1,734 @@
|
|
|
1
|
+
import { createConsole } from "./utils/Console.ts";
|
|
2
|
+
import EventDispatcher, { BoundEventListeners, Event, EventListenerMap, EventMap } from "./utils/EventDispatcher.ts";
|
|
3
|
+
import BaseConnectionManager, {
|
|
4
|
+
TxMessage,
|
|
5
|
+
TxRxMessageType,
|
|
6
|
+
ConnectionStatus,
|
|
7
|
+
ConnectionMessageType,
|
|
8
|
+
MetaConnectionMessageTypes,
|
|
9
|
+
BatteryLevelMessageTypes,
|
|
10
|
+
ConnectionEventTypes,
|
|
11
|
+
ConnectionStatusEventMessages,
|
|
12
|
+
} from "./connection/BaseConnectionManager.ts";
|
|
13
|
+
import { isInBrowser, isInNode } from "./utils/environment.ts";
|
|
14
|
+
import WebBluetoothConnectionManager from "./connection/bluetooth/WebBluetoothConnectionManager.ts";
|
|
15
|
+
import SensorConfigurationManager, {
|
|
16
|
+
SendSensorConfigurationMessageCallback,
|
|
17
|
+
SensorConfiguration,
|
|
18
|
+
SensorConfigurationEventDispatcher,
|
|
19
|
+
SensorConfigurationEventMessages,
|
|
20
|
+
SensorConfigurationEventTypes,
|
|
21
|
+
SensorConfigurationMessageType,
|
|
22
|
+
SensorConfigurationMessageTypes,
|
|
23
|
+
} from "./sensor/SensorConfigurationManager.ts";
|
|
24
|
+
import SensorDataManager, {
|
|
25
|
+
SensorDataEventMessages,
|
|
26
|
+
SensorDataEventTypes,
|
|
27
|
+
SensorDataMessageType,
|
|
28
|
+
SensorDataMessageTypes,
|
|
29
|
+
SensorType,
|
|
30
|
+
ContinuousSensorTypes,
|
|
31
|
+
SensorDataEventDispatcher,
|
|
32
|
+
} from "./sensor/SensorDataManager.ts";
|
|
33
|
+
import VibrationManager, {
|
|
34
|
+
SendVibrationMessageCallback,
|
|
35
|
+
VibrationConfiguration,
|
|
36
|
+
} from "./vibration/VibrationManager.ts";
|
|
37
|
+
import FileTransferManager, {
|
|
38
|
+
FileTransferEventTypes,
|
|
39
|
+
FileTransferEventMessages,
|
|
40
|
+
FileTransferEventDispatcher,
|
|
41
|
+
SendFileTransferMessageCallback,
|
|
42
|
+
FileTransferMessageTypes,
|
|
43
|
+
FileTransferMessageType,
|
|
44
|
+
FileType,
|
|
45
|
+
} from "./FileTransferManager.ts";
|
|
46
|
+
import TfliteManager, {
|
|
47
|
+
TfliteEventTypes,
|
|
48
|
+
TfliteEventMessages,
|
|
49
|
+
TfliteEventDispatcher,
|
|
50
|
+
SendTfliteMessageCallback,
|
|
51
|
+
TfliteMessageTypes,
|
|
52
|
+
TfliteMessageType,
|
|
53
|
+
TfliteSensorTypes,
|
|
54
|
+
} from "./TfliteManager.ts";
|
|
55
|
+
import FirmwareManager, {
|
|
56
|
+
FirmwareEventDispatcher,
|
|
57
|
+
FirmwareEventMessages,
|
|
58
|
+
FirmwareEventTypes,
|
|
59
|
+
FirmwareMessageType,
|
|
60
|
+
FirmwareMessageTypes,
|
|
61
|
+
} from "./FirmwareManager.ts";
|
|
62
|
+
import DeviceInformationManager, {
|
|
63
|
+
DeviceInformationEventDispatcher,
|
|
64
|
+
DeviceInformationEventTypes,
|
|
65
|
+
DeviceInformationMessageType,
|
|
66
|
+
DeviceInformationMessageTypes,
|
|
67
|
+
DeviceInformationEventMessages,
|
|
68
|
+
} from "./DeviceInformationManager.ts";
|
|
69
|
+
import InformationManager, {
|
|
70
|
+
DeviceType,
|
|
71
|
+
InformationEventDispatcher,
|
|
72
|
+
InformationEventTypes,
|
|
73
|
+
InformationMessageType,
|
|
74
|
+
InformationMessageTypes,
|
|
75
|
+
InformationEventMessages,
|
|
76
|
+
SendInformationMessageCallback,
|
|
77
|
+
} from "./InformationManager.ts";
|
|
78
|
+
import { FileLike } from "./utils/ArrayBufferUtils.ts";
|
|
79
|
+
import DeviceManager from "./DeviceManager.ts";
|
|
80
|
+
|
|
81
|
+
const _console = createConsole("Device", { log: true });
|
|
82
|
+
|
|
83
|
+
export const DeviceEventTypes = [
|
|
84
|
+
"connectionMessage",
|
|
85
|
+
...ConnectionEventTypes,
|
|
86
|
+
...MetaConnectionMessageTypes,
|
|
87
|
+
...BatteryLevelMessageTypes,
|
|
88
|
+
...InformationEventTypes,
|
|
89
|
+
...DeviceInformationEventTypes,
|
|
90
|
+
...SensorConfigurationEventTypes,
|
|
91
|
+
...SensorDataEventTypes,
|
|
92
|
+
...FileTransferEventTypes,
|
|
93
|
+
...TfliteEventTypes,
|
|
94
|
+
...FirmwareEventTypes,
|
|
95
|
+
] as const;
|
|
96
|
+
export type DeviceEventType = (typeof DeviceEventTypes)[number];
|
|
97
|
+
|
|
98
|
+
export interface DeviceEventMessages
|
|
99
|
+
extends ConnectionStatusEventMessages,
|
|
100
|
+
DeviceInformationEventMessages,
|
|
101
|
+
InformationEventMessages,
|
|
102
|
+
SensorDataEventMessages,
|
|
103
|
+
SensorConfigurationEventMessages,
|
|
104
|
+
TfliteEventMessages,
|
|
105
|
+
FileTransferEventMessages,
|
|
106
|
+
FirmwareEventMessages {
|
|
107
|
+
batteryLevel: { batteryLevel: number };
|
|
108
|
+
connectionMessage: { messageType: ConnectionMessageType; dataView: DataView };
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export type SendMessageCallback<MessageType extends string> = (
|
|
112
|
+
messages?: { type: MessageType; data?: ArrayBuffer }[],
|
|
113
|
+
sendImmediately?: boolean
|
|
114
|
+
) => Promise<void>;
|
|
115
|
+
|
|
116
|
+
export type SendSmpMessageCallback = (data: ArrayBuffer) => Promise<void>;
|
|
117
|
+
|
|
118
|
+
export type DeviceEventDispatcher = EventDispatcher<Device, DeviceEventType, DeviceEventMessages>;
|
|
119
|
+
export type DeviceEvent = Event<Device, DeviceEventType, DeviceEventMessages>;
|
|
120
|
+
export type DeviceEventMap = EventMap<Device, DeviceEventType, DeviceEventMessages>;
|
|
121
|
+
export type DeviceEventListenerMap = EventListenerMap<Device, DeviceEventType, DeviceEventMessages>;
|
|
122
|
+
export type BoundDeviceEventListeners = BoundEventListeners<Device, DeviceEventType, DeviceEventMessages>;
|
|
123
|
+
|
|
124
|
+
export const RequiredInformationConnectionMessages: TxRxMessageType[] = [
|
|
125
|
+
"isCharging",
|
|
126
|
+
"getBatteryCurrent",
|
|
127
|
+
"getId",
|
|
128
|
+
"getMtu",
|
|
129
|
+
|
|
130
|
+
"getName",
|
|
131
|
+
"getType",
|
|
132
|
+
"getCurrentTime",
|
|
133
|
+
"getSensorConfiguration",
|
|
134
|
+
"getSensorScalars",
|
|
135
|
+
"getPressurePositions",
|
|
136
|
+
|
|
137
|
+
"maxFileLength",
|
|
138
|
+
"getFileLength",
|
|
139
|
+
"getFileChecksum",
|
|
140
|
+
"getFileType",
|
|
141
|
+
"fileTransferStatus",
|
|
142
|
+
|
|
143
|
+
"getTfliteName",
|
|
144
|
+
"getTfliteTask",
|
|
145
|
+
"getTfliteSampleRate",
|
|
146
|
+
"getTfliteSensorTypes",
|
|
147
|
+
"tfliteIsReady",
|
|
148
|
+
"getTfliteCaptureDelay",
|
|
149
|
+
"getTfliteThreshold",
|
|
150
|
+
"getTfliteInferencingEnabled",
|
|
151
|
+
];
|
|
152
|
+
|
|
153
|
+
class Device {
|
|
154
|
+
get bluetoothId() {
|
|
155
|
+
return this.#connectionManager?.bluetoothId;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
constructor() {
|
|
159
|
+
this.#deviceInformationManager.eventDispatcher = this.#eventDispatcher as DeviceInformationEventDispatcher;
|
|
160
|
+
|
|
161
|
+
this._informationManager.sendMessage = this.sendTxMessages as SendInformationMessageCallback;
|
|
162
|
+
this._informationManager.eventDispatcher = this.#eventDispatcher as InformationEventDispatcher;
|
|
163
|
+
|
|
164
|
+
this.#sensorConfigurationManager.sendMessage = this.sendTxMessages as SendSensorConfigurationMessageCallback;
|
|
165
|
+
this.#sensorConfigurationManager.eventDispatcher = this.#eventDispatcher as SensorConfigurationEventDispatcher;
|
|
166
|
+
|
|
167
|
+
this.#sensorDataManager.eventDispatcher = this.#eventDispatcher as SensorDataEventDispatcher;
|
|
168
|
+
|
|
169
|
+
this.#vibrationManager.sendMessage = this.sendTxMessages as SendVibrationMessageCallback;
|
|
170
|
+
|
|
171
|
+
this.#tfliteManager.sendMessage = this.sendTxMessages as SendTfliteMessageCallback;
|
|
172
|
+
this.#tfliteManager.eventDispatcher = this.#eventDispatcher as TfliteEventDispatcher;
|
|
173
|
+
|
|
174
|
+
this.#fileTransferManager.sendMessage = this.sendTxMessages as SendFileTransferMessageCallback;
|
|
175
|
+
this.#fileTransferManager.eventDispatcher = this.#eventDispatcher as FileTransferEventDispatcher;
|
|
176
|
+
|
|
177
|
+
this.#firmwareManager.sendMessage = this.sendSmpMessage as SendSmpMessageCallback;
|
|
178
|
+
this.#firmwareManager.eventDispatcher = this.#eventDispatcher as FirmwareEventDispatcher;
|
|
179
|
+
|
|
180
|
+
this.addEventListener("getMtu", () => {
|
|
181
|
+
this.#firmwareManager.mtu = this.mtu;
|
|
182
|
+
this.#fileTransferManager.mtu = this.mtu;
|
|
183
|
+
this.connectionManager!.mtu = this.mtu;
|
|
184
|
+
});
|
|
185
|
+
DeviceManager.onDevice(this);
|
|
186
|
+
if (isInBrowser) {
|
|
187
|
+
window.addEventListener("beforeunload", () => {
|
|
188
|
+
if (this.isConnected && this.clearSensorConfigurationOnLeave) {
|
|
189
|
+
this.clearSensorConfiguration();
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
if (isInNode) {
|
|
194
|
+
/** can add more node leave handlers https://gist.github.com/hyrious/30a878f6e6a057f09db87638567cb11a */
|
|
195
|
+
process.on("exit", () => {
|
|
196
|
+
if (this.isConnected && this.clearSensorConfigurationOnLeave) {
|
|
197
|
+
this.clearSensorConfiguration();
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
static #DefaultConnectionManager(): BaseConnectionManager {
|
|
204
|
+
return new WebBluetoothConnectionManager();
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
#eventDispatcher: DeviceEventDispatcher = new EventDispatcher(this as Device, DeviceEventTypes);
|
|
208
|
+
get addEventListener() {
|
|
209
|
+
return this.#eventDispatcher.addEventListener;
|
|
210
|
+
}
|
|
211
|
+
get #dispatchEvent() {
|
|
212
|
+
return this.#eventDispatcher.dispatchEvent;
|
|
213
|
+
}
|
|
214
|
+
get removeEventListener() {
|
|
215
|
+
return this.#eventDispatcher.removeEventListener;
|
|
216
|
+
}
|
|
217
|
+
get waitForEvent() {
|
|
218
|
+
return this.#eventDispatcher.waitForEvent;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
// CONNECTION MANAGER
|
|
222
|
+
|
|
223
|
+
#connectionManager?: BaseConnectionManager;
|
|
224
|
+
get connectionManager() {
|
|
225
|
+
return this.#connectionManager;
|
|
226
|
+
}
|
|
227
|
+
set connectionManager(newConnectionManager) {
|
|
228
|
+
if (this.connectionManager == newConnectionManager) {
|
|
229
|
+
_console.log("same connectionManager is already assigned");
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if (this.connectionManager) {
|
|
234
|
+
this.connectionManager.onStatusUpdated = undefined;
|
|
235
|
+
this.connectionManager.onMessageReceived = undefined;
|
|
236
|
+
}
|
|
237
|
+
if (newConnectionManager) {
|
|
238
|
+
newConnectionManager.onStatusUpdated = this.#onConnectionStatusUpdated.bind(this);
|
|
239
|
+
newConnectionManager.onMessageReceived = this.#onConnectionMessageReceived.bind(this);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
this.#connectionManager = newConnectionManager;
|
|
243
|
+
_console.log("assigned new connectionManager", this.#connectionManager);
|
|
244
|
+
}
|
|
245
|
+
async #sendTxMessages(messages: TxMessage[], sendImmediately?: boolean) {
|
|
246
|
+
await this.#connectionManager?.sendTxMessages(messages, sendImmediately);
|
|
247
|
+
}
|
|
248
|
+
private sendTxMessages = this.#sendTxMessages.bind(this);
|
|
249
|
+
|
|
250
|
+
async connect() {
|
|
251
|
+
if (!this.connectionManager) {
|
|
252
|
+
this.connectionManager = Device.#DefaultConnectionManager();
|
|
253
|
+
}
|
|
254
|
+
this.#clear();
|
|
255
|
+
return this.connectionManager.connect();
|
|
256
|
+
}
|
|
257
|
+
#isConnected = false;
|
|
258
|
+
get isConnected() {
|
|
259
|
+
return this.#isConnected;
|
|
260
|
+
}
|
|
261
|
+
/** @throws {Error} if not connected */
|
|
262
|
+
#assertIsConnected() {
|
|
263
|
+
_console.assertWithError(this.isConnected, "notConnected");
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
get #hasRequiredInformation() {
|
|
267
|
+
return RequiredInformationConnectionMessages.every((messageType) => {
|
|
268
|
+
return this.latestConnectionMessage.has(messageType);
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
#requestRequiredInformation() {
|
|
272
|
+
const messages: TxMessage[] = RequiredInformationConnectionMessages.map((messageType) => ({
|
|
273
|
+
type: messageType,
|
|
274
|
+
}));
|
|
275
|
+
this.#sendTxMessages(messages);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
get canReconnect() {
|
|
279
|
+
return this.connectionManager?.canReconnect;
|
|
280
|
+
}
|
|
281
|
+
#assertCanReconnect() {
|
|
282
|
+
_console.assertWithError(this.canReconnect, "cannot reconnect to device");
|
|
283
|
+
}
|
|
284
|
+
async reconnect() {
|
|
285
|
+
this.#assertCanReconnect();
|
|
286
|
+
this.#clear();
|
|
287
|
+
return this.connectionManager?.reconnect();
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
static async Connect() {
|
|
291
|
+
const device = new Device();
|
|
292
|
+
await device.connect();
|
|
293
|
+
return device;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
static #ReconnectOnDisconnection = false;
|
|
297
|
+
static get ReconnectOnDisconnection() {
|
|
298
|
+
return this.#ReconnectOnDisconnection;
|
|
299
|
+
}
|
|
300
|
+
static set ReconnectOnDisconnection(newReconnectOnDisconnection) {
|
|
301
|
+
_console.assertTypeWithError(newReconnectOnDisconnection, "boolean");
|
|
302
|
+
this.#ReconnectOnDisconnection = newReconnectOnDisconnection;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
#reconnectOnDisconnection = Device.ReconnectOnDisconnection;
|
|
306
|
+
get reconnectOnDisconnection() {
|
|
307
|
+
return this.#reconnectOnDisconnection;
|
|
308
|
+
}
|
|
309
|
+
set reconnectOnDisconnection(newReconnectOnDisconnection) {
|
|
310
|
+
_console.assertTypeWithError(newReconnectOnDisconnection, "boolean");
|
|
311
|
+
this.#reconnectOnDisconnection = newReconnectOnDisconnection;
|
|
312
|
+
}
|
|
313
|
+
#reconnectIntervalId?: NodeJS.Timeout | number;
|
|
314
|
+
|
|
315
|
+
get connectionType() {
|
|
316
|
+
return this.connectionManager?.type;
|
|
317
|
+
}
|
|
318
|
+
async disconnect() {
|
|
319
|
+
this.#assertIsConnected();
|
|
320
|
+
if (this.reconnectOnDisconnection) {
|
|
321
|
+
this.reconnectOnDisconnection = false;
|
|
322
|
+
this.addEventListener(
|
|
323
|
+
"isConnected",
|
|
324
|
+
() => {
|
|
325
|
+
this.reconnectOnDisconnection = true;
|
|
326
|
+
},
|
|
327
|
+
{ once: true }
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
return this.connectionManager!.disconnect();
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
toggleConnection() {
|
|
335
|
+
if (this.isConnected) {
|
|
336
|
+
this.disconnect();
|
|
337
|
+
} else if (this.canReconnect) {
|
|
338
|
+
this.reconnect();
|
|
339
|
+
} else {
|
|
340
|
+
this.connect();
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
get connectionStatus(): ConnectionStatus {
|
|
345
|
+
switch (this.#connectionManager?.status) {
|
|
346
|
+
case "connected":
|
|
347
|
+
return this.isConnected ? "connected" : "connecting";
|
|
348
|
+
case "notConnected":
|
|
349
|
+
case "connecting":
|
|
350
|
+
case "disconnecting":
|
|
351
|
+
return this.#connectionManager.status;
|
|
352
|
+
default:
|
|
353
|
+
return "notConnected";
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
get isConnectionBusy() {
|
|
357
|
+
return this.connectionStatus == "connecting" || this.connectionStatus == "disconnecting";
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
#onConnectionStatusUpdated(connectionStatus: ConnectionStatus) {
|
|
361
|
+
_console.log({ connectionStatus });
|
|
362
|
+
|
|
363
|
+
if (connectionStatus == "notConnected") {
|
|
364
|
+
//this.#clear();
|
|
365
|
+
|
|
366
|
+
if (this.canReconnect && this.reconnectOnDisconnection) {
|
|
367
|
+
_console.log("starting reconnect interval...");
|
|
368
|
+
this.#reconnectIntervalId = setInterval(() => {
|
|
369
|
+
_console.log("attempting reconnect...");
|
|
370
|
+
this.reconnect();
|
|
371
|
+
}, 1000);
|
|
372
|
+
}
|
|
373
|
+
} else {
|
|
374
|
+
if (this.#reconnectIntervalId != undefined) {
|
|
375
|
+
_console.log("clearing reconnect interval");
|
|
376
|
+
clearInterval(this.#reconnectIntervalId);
|
|
377
|
+
this.#reconnectIntervalId = undefined;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
this.#checkConnection();
|
|
382
|
+
|
|
383
|
+
if (connectionStatus == "connected" && !this.#isConnected) {
|
|
384
|
+
this.#requestRequiredInformation();
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
DeviceManager.OnDeviceConnectionStatusUpdated(this, connectionStatus);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
#dispatchConnectionEvents(includeIsConnected: boolean = false) {
|
|
391
|
+
this.#dispatchEvent("connectionStatus", { connectionStatus: this.connectionStatus });
|
|
392
|
+
this.#dispatchEvent(this.connectionStatus, {});
|
|
393
|
+
if (includeIsConnected) {
|
|
394
|
+
this.#dispatchEvent("isConnected", { isConnected: this.isConnected });
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
#checkConnection() {
|
|
398
|
+
this.#isConnected =
|
|
399
|
+
Boolean(this.connectionManager?.isConnected) &&
|
|
400
|
+
this.#hasRequiredInformation &&
|
|
401
|
+
this._informationManager.isCurrentTimeSet;
|
|
402
|
+
|
|
403
|
+
switch (this.connectionStatus) {
|
|
404
|
+
case "connected":
|
|
405
|
+
if (this.#isConnected) {
|
|
406
|
+
this.#dispatchConnectionEvents(true);
|
|
407
|
+
}
|
|
408
|
+
break;
|
|
409
|
+
case "notConnected":
|
|
410
|
+
this.#dispatchConnectionEvents(true);
|
|
411
|
+
break;
|
|
412
|
+
default:
|
|
413
|
+
this.#dispatchConnectionEvents(false);
|
|
414
|
+
break;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
#clear() {
|
|
419
|
+
this.latestConnectionMessage.clear();
|
|
420
|
+
this._informationManager.clear();
|
|
421
|
+
this.#deviceInformationManager.clear();
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
#onConnectionMessageReceived(messageType: ConnectionMessageType, dataView: DataView) {
|
|
425
|
+
_console.log({ messageType, dataView });
|
|
426
|
+
switch (messageType) {
|
|
427
|
+
case "batteryLevel":
|
|
428
|
+
const batteryLevel = dataView.getUint8(0);
|
|
429
|
+
_console.log("received battery level", { batteryLevel });
|
|
430
|
+
this.#updateBatteryLevel(batteryLevel);
|
|
431
|
+
break;
|
|
432
|
+
|
|
433
|
+
default:
|
|
434
|
+
if (FileTransferMessageTypes.includes(messageType as FileTransferMessageType)) {
|
|
435
|
+
this.#fileTransferManager.parseMessage(messageType as FileTransferMessageType, dataView);
|
|
436
|
+
} else if (TfliteMessageTypes.includes(messageType as TfliteMessageType)) {
|
|
437
|
+
this.#tfliteManager.parseMessage(messageType as TfliteMessageType, dataView);
|
|
438
|
+
} else if (SensorDataMessageTypes.includes(messageType as SensorDataMessageType)) {
|
|
439
|
+
this.#sensorDataManager.parseMessage(messageType as SensorDataMessageType, dataView);
|
|
440
|
+
} else if (FirmwareMessageTypes.includes(messageType as FirmwareMessageType)) {
|
|
441
|
+
this.#firmwareManager.parseMessage(messageType as FirmwareMessageType, dataView);
|
|
442
|
+
} else if (DeviceInformationMessageTypes.includes(messageType as DeviceInformationMessageType)) {
|
|
443
|
+
this.#deviceInformationManager.parseMessage(messageType as DeviceInformationMessageType, dataView);
|
|
444
|
+
} else if (InformationMessageTypes.includes(messageType as InformationMessageType)) {
|
|
445
|
+
this._informationManager.parseMessage(messageType as InformationMessageType, dataView);
|
|
446
|
+
} else if (SensorConfigurationMessageTypes.includes(messageType as SensorConfigurationMessageType)) {
|
|
447
|
+
this.#sensorConfigurationManager.parseMessage(messageType as SensorConfigurationMessageType, dataView);
|
|
448
|
+
} else {
|
|
449
|
+
throw Error(`uncaught messageType ${messageType}`);
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
this.latestConnectionMessage.set(messageType, dataView);
|
|
454
|
+
this.#dispatchEvent("connectionMessage", { messageType, dataView });
|
|
455
|
+
|
|
456
|
+
if (!this.isConnected && this.#hasRequiredInformation) {
|
|
457
|
+
this.#checkConnection();
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
latestConnectionMessage: Map<ConnectionMessageType, DataView> = new Map();
|
|
462
|
+
|
|
463
|
+
// DEVICE INFORMATION
|
|
464
|
+
#deviceInformationManager = new DeviceInformationManager();
|
|
465
|
+
get deviceInformation() {
|
|
466
|
+
return this.#deviceInformationManager.information;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
// BATTERY LEVEL
|
|
470
|
+
#batteryLevel = 0;
|
|
471
|
+
get batteryLevel() {
|
|
472
|
+
return this.#batteryLevel;
|
|
473
|
+
}
|
|
474
|
+
#updateBatteryLevel(updatedBatteryLevel: number) {
|
|
475
|
+
_console.assertTypeWithError(updatedBatteryLevel, "number");
|
|
476
|
+
if (this.#batteryLevel == updatedBatteryLevel) {
|
|
477
|
+
_console.log(`duplicate batteryLevel assignment ${updatedBatteryLevel}`);
|
|
478
|
+
return;
|
|
479
|
+
}
|
|
480
|
+
this.#batteryLevel = updatedBatteryLevel;
|
|
481
|
+
_console.log({ updatedBatteryLevel: this.#batteryLevel });
|
|
482
|
+
this.#dispatchEvent("batteryLevel", { batteryLevel: this.#batteryLevel });
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// INFORMATION
|
|
486
|
+
/** @private */
|
|
487
|
+
_informationManager = new InformationManager();
|
|
488
|
+
|
|
489
|
+
get id() {
|
|
490
|
+
return this._informationManager.id;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
get isCharging() {
|
|
494
|
+
return this._informationManager.isCharging;
|
|
495
|
+
}
|
|
496
|
+
get batteryCurrent() {
|
|
497
|
+
return this._informationManager.batteryCurrent;
|
|
498
|
+
}
|
|
499
|
+
get getBatteryCurrent() {
|
|
500
|
+
return this._informationManager.getBatteryCurrent;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
get name() {
|
|
504
|
+
return this._informationManager.name;
|
|
505
|
+
}
|
|
506
|
+
get setName() {
|
|
507
|
+
return this._informationManager.setName;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
get type() {
|
|
511
|
+
return this._informationManager.type;
|
|
512
|
+
}
|
|
513
|
+
get setType() {
|
|
514
|
+
return this._informationManager.setType;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
get isInsole() {
|
|
518
|
+
return this._informationManager.isInsole;
|
|
519
|
+
}
|
|
520
|
+
get insoleSide() {
|
|
521
|
+
return this._informationManager.insoleSide;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
get mtu() {
|
|
525
|
+
return this._informationManager.mtu;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
// SENSOR TYPES
|
|
529
|
+
get sensorTypes() {
|
|
530
|
+
return Object.keys(this.sensorConfiguration) as SensorType[];
|
|
531
|
+
}
|
|
532
|
+
get continuousSensorTypes() {
|
|
533
|
+
return ContinuousSensorTypes.filter((sensorType) => this.sensorTypes.includes(sensorType));
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// SENSOR CONFIGURATION
|
|
537
|
+
|
|
538
|
+
#sensorConfigurationManager = new SensorConfigurationManager();
|
|
539
|
+
|
|
540
|
+
get sensorConfiguration() {
|
|
541
|
+
return this.#sensorConfigurationManager.configuration;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
async setSensorConfiguration(newSensorConfiguration: SensorConfiguration, clearRest?: boolean) {
|
|
545
|
+
await this.#sensorConfigurationManager.setConfiguration(newSensorConfiguration, clearRest);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
async clearSensorConfiguration() {
|
|
549
|
+
return this.#sensorConfigurationManager.clearSensorConfiguration();
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
static #ClearSensorConfigurationOnLeave = true;
|
|
553
|
+
static get ClearSensorConfigurationOnLeave() {
|
|
554
|
+
return this.#ClearSensorConfigurationOnLeave;
|
|
555
|
+
}
|
|
556
|
+
static set ClearSensorConfigurationOnLeave(newClearSensorConfigurationOnLeave) {
|
|
557
|
+
_console.assertTypeWithError(newClearSensorConfigurationOnLeave, "boolean");
|
|
558
|
+
this.#ClearSensorConfigurationOnLeave = newClearSensorConfigurationOnLeave;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
#clearSensorConfigurationOnLeave = Device.ClearSensorConfigurationOnLeave;
|
|
562
|
+
get clearSensorConfigurationOnLeave() {
|
|
563
|
+
return this.#clearSensorConfigurationOnLeave;
|
|
564
|
+
}
|
|
565
|
+
set clearSensorConfigurationOnLeave(newClearSensorConfigurationOnLeave) {
|
|
566
|
+
_console.assertTypeWithError(newClearSensorConfigurationOnLeave, "boolean");
|
|
567
|
+
this.#clearSensorConfigurationOnLeave = newClearSensorConfigurationOnLeave;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
// PRESSURE
|
|
571
|
+
get numberOfPressureSensors() {
|
|
572
|
+
return this.#sensorDataManager.pressureSensorDataManager.numberOfSensors;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
// SENSOR DATA
|
|
576
|
+
#sensorDataManager = new SensorDataManager();
|
|
577
|
+
resetPressureRange() {
|
|
578
|
+
this.#sensorDataManager.pressureSensorDataManager.resetRange();
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
// VIBRATION
|
|
582
|
+
#vibrationManager = new VibrationManager();
|
|
583
|
+
async triggerVibration(vibrationConfigurations: VibrationConfiguration[], sendImmediately?: boolean) {
|
|
584
|
+
this.#vibrationManager.triggerVibration(vibrationConfigurations, sendImmediately);
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
// FILE TRANSFER
|
|
588
|
+
#fileTransferManager = new FileTransferManager();
|
|
589
|
+
|
|
590
|
+
get maxFileLength() {
|
|
591
|
+
return this.#fileTransferManager.maxLength;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
async sendFile(fileType: FileType, file: FileLike) {
|
|
595
|
+
const promise = this.waitForEvent("fileTransferComplete");
|
|
596
|
+
this.#fileTransferManager.send(fileType, file);
|
|
597
|
+
await promise;
|
|
598
|
+
}
|
|
599
|
+
async receiveFile(fileType: FileType) {
|
|
600
|
+
const promise = this.waitForEvent("fileTransferComplete");
|
|
601
|
+
this.#fileTransferManager.receive(fileType);
|
|
602
|
+
await promise;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
get fileTransferStatus() {
|
|
606
|
+
return this.#fileTransferManager.status;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
cancelFileTransfer() {
|
|
610
|
+
this.#fileTransferManager.cancel();
|
|
611
|
+
}
|
|
612
|
+
|
|
613
|
+
// TFLITE
|
|
614
|
+
#tfliteManager = new TfliteManager();
|
|
615
|
+
|
|
616
|
+
get tfliteName() {
|
|
617
|
+
return this.#tfliteManager.name;
|
|
618
|
+
}
|
|
619
|
+
get setTfliteName() {
|
|
620
|
+
return this.#tfliteManager.setName;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
// TFLITE MODEL CONFIG
|
|
624
|
+
get tfliteTask() {
|
|
625
|
+
return this.#tfliteManager.task;
|
|
626
|
+
}
|
|
627
|
+
get setTfliteTask() {
|
|
628
|
+
return this.#tfliteManager.setTask;
|
|
629
|
+
}
|
|
630
|
+
get tfliteSampleRate() {
|
|
631
|
+
return this.#tfliteManager.sampleRate;
|
|
632
|
+
}
|
|
633
|
+
get setTfliteSampleRate() {
|
|
634
|
+
return this.#tfliteManager.setSampleRate;
|
|
635
|
+
}
|
|
636
|
+
get tfliteSensorTypes() {
|
|
637
|
+
return this.#tfliteManager.sensorTypes;
|
|
638
|
+
}
|
|
639
|
+
get allowedTfliteSensorTypes() {
|
|
640
|
+
return this.sensorTypes.filter((sensorType) => TfliteSensorTypes.includes(sensorType));
|
|
641
|
+
}
|
|
642
|
+
get setTfliteSensorTypes() {
|
|
643
|
+
return this.#tfliteManager.setSensorTypes;
|
|
644
|
+
}
|
|
645
|
+
get tfliteIsReady() {
|
|
646
|
+
return this.#tfliteManager.isReady;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
// TFLITE INFERENCING
|
|
650
|
+
|
|
651
|
+
get tfliteInferencingEnabled() {
|
|
652
|
+
return this.#tfliteManager.inferencingEnabled;
|
|
653
|
+
}
|
|
654
|
+
get setTfliteInferencingEnabled() {
|
|
655
|
+
return this.#tfliteManager.setInferencingEnabled;
|
|
656
|
+
}
|
|
657
|
+
async enableTfliteInferencing() {
|
|
658
|
+
return this.setTfliteInferencingEnabled(true);
|
|
659
|
+
}
|
|
660
|
+
async disableTfliteInferencing() {
|
|
661
|
+
return this.setTfliteInferencingEnabled(false);
|
|
662
|
+
}
|
|
663
|
+
get toggleTfliteInferencing() {
|
|
664
|
+
return this.#tfliteManager.toggleInferencingEnabled;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
// TFLITE INFERENCE CONFIG
|
|
668
|
+
|
|
669
|
+
get tfliteCaptureDelay() {
|
|
670
|
+
return this.#tfliteManager.captureDelay;
|
|
671
|
+
}
|
|
672
|
+
get setTfliteCaptureDelay() {
|
|
673
|
+
return this.#tfliteManager.setCaptureDelay;
|
|
674
|
+
}
|
|
675
|
+
get tfliteThreshold() {
|
|
676
|
+
return this.#tfliteManager.threshold;
|
|
677
|
+
}
|
|
678
|
+
get setTfliteThreshold() {
|
|
679
|
+
return this.#tfliteManager.setThreshold;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
// FIRMWARE MANAGER
|
|
683
|
+
|
|
684
|
+
#firmwareManager = new FirmwareManager();
|
|
685
|
+
|
|
686
|
+
#sendSmpMessage(data: ArrayBuffer) {
|
|
687
|
+
return this.#connectionManager!.sendSmpMessage(data);
|
|
688
|
+
}
|
|
689
|
+
private sendSmpMessage = this.#sendSmpMessage.bind(this);
|
|
690
|
+
|
|
691
|
+
get uploadFirmware() {
|
|
692
|
+
return this.#firmwareManager.uploadFirmware;
|
|
693
|
+
}
|
|
694
|
+
async reset() {
|
|
695
|
+
await this.#firmwareManager.reset();
|
|
696
|
+
return this.#connectionManager!.disconnect();
|
|
697
|
+
}
|
|
698
|
+
get firmwareStatus() {
|
|
699
|
+
return this.#firmwareManager.status;
|
|
700
|
+
}
|
|
701
|
+
get getFirmwareImages() {
|
|
702
|
+
return this.#firmwareManager.getImages;
|
|
703
|
+
}
|
|
704
|
+
get firmwareImages() {
|
|
705
|
+
return this.#firmwareManager.images;
|
|
706
|
+
}
|
|
707
|
+
get eraseFirmwareImage() {
|
|
708
|
+
return this.#firmwareManager.eraseImage;
|
|
709
|
+
}
|
|
710
|
+
get confirmFirmwareImage() {
|
|
711
|
+
return this.#firmwareManager.confirmImage;
|
|
712
|
+
}
|
|
713
|
+
get testFirmwareImage() {
|
|
714
|
+
return this.#firmwareManager.testImage;
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
// SERVER SIDE
|
|
718
|
+
#isServerSide = false;
|
|
719
|
+
get isServerSide() {
|
|
720
|
+
return this.#isServerSide;
|
|
721
|
+
}
|
|
722
|
+
set isServerSide(newIsServerSide) {
|
|
723
|
+
if (this.#isServerSide == newIsServerSide) {
|
|
724
|
+
_console.log("redundant isServerSide assignment");
|
|
725
|
+
return;
|
|
726
|
+
}
|
|
727
|
+
_console.log({ newIsServerSide });
|
|
728
|
+
this.#isServerSide = newIsServerSide;
|
|
729
|
+
|
|
730
|
+
this.#fileTransferManager.isServerSide = this.isServerSide;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
export default Device;
|