@onekeyfe/hd-transport-web-device 1.2.0-alpha.71 → 1.2.0-alpha.72
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.
|
@@ -198,7 +198,7 @@ describe('ElectronBleTransport protocol detection', () => {
|
|
|
198
198
|
const context = {
|
|
199
199
|
messageName: 'Ping',
|
|
200
200
|
timeoutMs: 1000,
|
|
201
|
-
|
|
201
|
+
highThroughput: false,
|
|
202
202
|
generation: 1,
|
|
203
203
|
signal: new AbortController().signal,
|
|
204
204
|
};
|
|
@@ -207,6 +207,9 @@ describe('ElectronBleTransport protocol detection', () => {
|
|
|
207
207
|
|
|
208
208
|
expect(nobleBle.write).toHaveBeenCalledTimes(2);
|
|
209
209
|
expect(nobleBle.write.mock.calls.map(([, hex]) => hex.length / 2)).toEqual([192, 1]);
|
|
210
|
+
expect(nobleBle.write.mock.calls.every(([, , options]) => options?.pacingDelayMs === 0)).toBe(
|
|
211
|
+
true
|
|
212
|
+
);
|
|
210
213
|
});
|
|
211
214
|
|
|
212
215
|
test('uses the negotiated Noble MTU for Protocol V2 BLE writes', async () => {
|
|
@@ -216,7 +219,7 @@ describe('ElectronBleTransport protocol detection', () => {
|
|
|
216
219
|
const context = {
|
|
217
220
|
messageName: 'FilesystemFileWrite',
|
|
218
221
|
timeoutMs: 1000,
|
|
219
|
-
|
|
222
|
+
highThroughput: true,
|
|
220
223
|
generation: 1,
|
|
221
224
|
signal: new AbortController().signal,
|
|
222
225
|
};
|
|
@@ -247,7 +250,7 @@ describe('ElectronBleTransport protocol detection', () => {
|
|
|
247
250
|
const context = {
|
|
248
251
|
messageName: 'FilesystemFileWrite',
|
|
249
252
|
timeoutMs: 1000,
|
|
250
|
-
|
|
253
|
+
highThroughput: true,
|
|
251
254
|
generation: 1,
|
|
252
255
|
signal: new AbortController().signal,
|
|
253
256
|
};
|
package/dist/index.js
CHANGED
|
@@ -1178,7 +1178,7 @@ class ElectronBleTransport {
|
|
|
1178
1178
|
if (!nobleBle) {
|
|
1179
1179
|
throw new Error('Noble BLE API not available');
|
|
1180
1180
|
}
|
|
1181
|
-
yield nobleBle.write(uuid, hexData);
|
|
1181
|
+
yield nobleBle.write(uuid, hexData, { pacingDelayMs: 0 });
|
|
1182
1182
|
});
|
|
1183
1183
|
}
|
|
1184
1184
|
refreshBlePacketCapacity(uuid) {
|
|
@@ -1212,7 +1212,7 @@ class ElectronBleTransport {
|
|
|
1212
1212
|
writeProtocolV2Frame(uuid, frame, context, assertCurrentGeneration) {
|
|
1213
1213
|
var _a;
|
|
1214
1214
|
const packetCapacity = (_a = this.devicePacketCapacities.get(uuid)) !== null && _a !== void 0 ? _a : BLE_PACKET_SIZE_FALLBACK;
|
|
1215
|
-
const shouldPace = !context.
|
|
1215
|
+
const shouldPace = !context.highThroughput;
|
|
1216
1216
|
return transport.writeProtocolV2BleFrame({
|
|
1217
1217
|
frame,
|
|
1218
1218
|
packetCapacity,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-transport-web-device",
|
|
3
|
-
"version": "1.2.0-alpha.
|
|
3
|
+
"version": "1.2.0-alpha.72",
|
|
4
4
|
"author": "OneKey",
|
|
5
5
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"lint:fix": "eslint . --fix"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@onekeyfe/hd-shared": "1.2.0-alpha.
|
|
25
|
-
"@onekeyfe/hd-transport": "1.2.0-alpha.
|
|
24
|
+
"@onekeyfe/hd-shared": "1.2.0-alpha.72",
|
|
25
|
+
"@onekeyfe/hd-transport": "1.2.0-alpha.72"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@onekeyfe/hd-transport-electron": "1.2.0-alpha.
|
|
28
|
+
"@onekeyfe/hd-transport-electron": "1.2.0-alpha.72",
|
|
29
29
|
"@types/w3c-web-usb": "^1.0.6",
|
|
30
30
|
"@types/web-bluetooth": "^0.0.17"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "76311ccd3753eca8e492b5324f93542bd38525ba"
|
|
33
33
|
}
|
|
@@ -584,7 +584,7 @@ export default class ElectronBleTransport {
|
|
|
584
584
|
throw new Error('Noble BLE API not available');
|
|
585
585
|
}
|
|
586
586
|
|
|
587
|
-
await nobleBle.write(uuid, hexData);
|
|
587
|
+
await nobleBle.write(uuid, hexData, { pacingDelayMs: 0 });
|
|
588
588
|
}
|
|
589
589
|
|
|
590
590
|
private async refreshBlePacketCapacity(uuid: string): Promise<void> {
|
|
@@ -623,7 +623,7 @@ export default class ElectronBleTransport {
|
|
|
623
623
|
assertCurrentGeneration: () => void
|
|
624
624
|
) {
|
|
625
625
|
const packetCapacity = this.devicePacketCapacities.get(uuid) ?? BLE_PACKET_SIZE_FALLBACK;
|
|
626
|
-
const shouldPace = !context.
|
|
626
|
+
const shouldPace = !context.highThroughput;
|
|
627
627
|
return writeProtocolV2BleFrame({
|
|
628
628
|
frame,
|
|
629
629
|
packetCapacity,
|