brilliantsole 0.0.24 → 0.0.25
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/build/brilliantsole.cjs +11 -1
- package/build/brilliantsole.cjs.map +1 -1
- package/build/brilliantsole.js +11 -1
- package/build/brilliantsole.js.map +1 -1
- package/build/brilliantsole.ls.js +11 -1
- 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 +1 -0
- package/build/brilliantsole.module.js +11 -1
- package/build/brilliantsole.module.js.map +1 -1
- package/build/brilliantsole.module.min.d.ts +1 -0
- package/build/brilliantsole.module.min.js +1 -1
- package/build/brilliantsole.module.min.js.map +1 -1
- package/build/brilliantsole.node.module.d.ts +1 -0
- package/build/brilliantsole.node.module.js +11 -1
- package/build/brilliantsole.node.module.js.map +1 -1
- package/build/dts/connection/BaseConnectionManager.d.ts +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.node.d.ts +1 -0
- package/package.json +1 -1
- package/src/Device.ts +1 -0
- package/src/FileTransferManager.ts +2 -1
- package/src/connection/BaseConnectionManager.ts +9 -1
package/build/index.d.ts
CHANGED
package/build/index.node.d.ts
CHANGED
package/package.json
CHANGED
package/src/Device.ts
CHANGED
|
@@ -217,7 +217,7 @@ class FileTransferManager {
|
|
|
217
217
|
this.#assertValidCommand(command);
|
|
218
218
|
|
|
219
219
|
const promise = this.waitForEvent("fileTransferStatus");
|
|
220
|
-
|
|
220
|
+
_console.log(`setting command ${command}`);
|
|
221
221
|
const commandEnum = FileTransferCommands.indexOf(command);
|
|
222
222
|
this.sendMessage(
|
|
223
223
|
[{ type: "setFileTransferCommand", data: Uint8Array.from([commandEnum]).buffer }],
|
|
@@ -433,6 +433,7 @@ class FileTransferManager {
|
|
|
433
433
|
|
|
434
434
|
async cancel() {
|
|
435
435
|
this.#assertIsNotIdle();
|
|
436
|
+
_console.log("cancelling file transfer...");
|
|
436
437
|
await this.#setCommand("cancel");
|
|
437
438
|
}
|
|
438
439
|
|
|
@@ -187,13 +187,16 @@ abstract class BaseConnectionManager {
|
|
|
187
187
|
|
|
188
188
|
if (messages) {
|
|
189
189
|
this.#pendingMessages.push(...messages);
|
|
190
|
+
_console.log(`appended ${messages.length} messages`);
|
|
190
191
|
}
|
|
191
192
|
|
|
192
193
|
if (!sendImmediately) {
|
|
194
|
+
_console.log("not sending immediately - waiting until later");
|
|
193
195
|
return;
|
|
194
196
|
}
|
|
195
197
|
|
|
196
198
|
if (this.#isSendingMessages) {
|
|
199
|
+
console.log("already sending messages - waiting until later");
|
|
197
200
|
return;
|
|
198
201
|
}
|
|
199
202
|
this.#isSendingMessages = true;
|
|
@@ -207,6 +210,7 @@ abstract class BaseConnectionManager {
|
|
|
207
210
|
dataLength.setUint16(0, message.data?.byteLength || 0, true);
|
|
208
211
|
return concatenateArrayBuffers(messageTypeEnum, dataLength, message.data);
|
|
209
212
|
});
|
|
213
|
+
this.#pendingMessages.length = 0;
|
|
210
214
|
|
|
211
215
|
if (this.mtu) {
|
|
212
216
|
while (arrayBuffers.length > 0) {
|
|
@@ -231,7 +235,6 @@ abstract class BaseConnectionManager {
|
|
|
231
235
|
_console.log("sending arrayBuffer", arrayBuffer);
|
|
232
236
|
await this.sendTxData(arrayBuffer);
|
|
233
237
|
}
|
|
234
|
-
this.#pendingMessages.length = 0;
|
|
235
238
|
|
|
236
239
|
this.#isSendingMessages = false;
|
|
237
240
|
}
|
|
@@ -260,6 +263,11 @@ abstract class BaseConnectionManager {
|
|
|
260
263
|
this.status = "notConnected";
|
|
261
264
|
}
|
|
262
265
|
}
|
|
266
|
+
|
|
267
|
+
clear() {
|
|
268
|
+
this.#isSendingMessages = false;
|
|
269
|
+
this.#pendingMessages.length = 0;
|
|
270
|
+
}
|
|
263
271
|
}
|
|
264
272
|
|
|
265
273
|
export default BaseConnectionManager;
|