@onekeyfe/hd-core 1.2.8-alpha.7 → 1.2.8
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/__tests__/DeviceCommands.test.ts +13 -66
- package/__tests__/core-error-output.test.ts +3 -34
- package/__tests__/device-lifecycle-events.test.ts +17 -64
- package/__tests__/device-pool-state.test.ts +0 -50
- package/__tests__/protocol-v2-bootloader-mode.test.ts +2 -31
- package/__tests__/protocol-v2.test.ts +47 -0
- package/__tests__/refresh-device-state.test.ts +17 -19
- package/dist/api/FirmwareUpdateV4.d.ts.map +1 -1
- package/dist/api/GetDeviceState.d.ts.map +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/device/Device.d.ts +0 -2
- package/dist/device/Device.d.ts.map +1 -1
- package/dist/device/DeviceCommands.d.ts +4 -4
- package/dist/device/DeviceCommands.d.ts.map +1 -1
- package/dist/device/DevicePool.d.ts.map +1 -1
- package/dist/index.d.ts +2 -6
- package/dist/index.js +28 -38
- package/dist/types/params.d.ts +0 -1
- package/dist/types/params.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/api/FirmwareUpdateV4.ts +25 -8
- package/src/api/GetDeviceState.ts +5 -2
- package/src/core/index.ts +7 -3
- package/src/device/Device.ts +1 -11
- package/src/device/DeviceCommands.ts +1 -15
- package/src/device/DevicePool.ts +2 -12
- package/src/events/core.ts +2 -2
- package/src/types/params.ts +1 -1
|
@@ -130,6 +130,19 @@ describe('DeviceCommands failure mapping', () => {
|
|
|
130
130
|
);
|
|
131
131
|
});
|
|
132
132
|
|
|
133
|
+
it('preserves the Protocol V2 peer-removed pairing error code', async () => {
|
|
134
|
+
const commands = createCommands();
|
|
135
|
+
const transportError = Object.assign(new Error('Peer removed pairing information'), {
|
|
136
|
+
errorCode: HardwareErrorCode.BlePeerRemovedPairingInformation,
|
|
137
|
+
});
|
|
138
|
+
commands.mainId = 'main-id';
|
|
139
|
+
commands.transport = {
|
|
140
|
+
call: jest.fn().mockRejectedValue(transportError),
|
|
141
|
+
} as any;
|
|
142
|
+
|
|
143
|
+
await expect(commands._commonCall('DeviceInfoGet', {})).rejects.toBe(transportError);
|
|
144
|
+
});
|
|
145
|
+
|
|
133
146
|
it('logs canonical DeviceStatus response fields without exposing the device ID', async () => {
|
|
134
147
|
const commands = createCommands();
|
|
135
148
|
const log = getLogger(LoggerNames.DeviceCommands);
|
|
@@ -401,27 +414,6 @@ describe('DeviceCommands failure mapping', () => {
|
|
|
401
414
|
).rejects.toMatchObject({ errorCode: HardwareErrorCode.DeviceBusy });
|
|
402
415
|
});
|
|
403
416
|
|
|
404
|
-
it('maps commands rejected during a Protocol V2 firmware update to DeviceBusy', async () => {
|
|
405
|
-
const commands = createCommands();
|
|
406
|
-
const message = 'Requested command not allowed while a firmware update is in progress';
|
|
407
|
-
|
|
408
|
-
await expect(
|
|
409
|
-
commands._filterCommonTypes(
|
|
410
|
-
{
|
|
411
|
-
type: 'Failure',
|
|
412
|
-
message: { code: 'Failure_ProcessError', message },
|
|
413
|
-
} as any,
|
|
414
|
-
'ProtocolInfoRequest'
|
|
415
|
-
)
|
|
416
|
-
).rejects.toMatchObject({
|
|
417
|
-
errorCode: HardwareErrorCode.DeviceBusy,
|
|
418
|
-
params: {
|
|
419
|
-
failureCode: 'Failure_ProcessError',
|
|
420
|
-
firmwareMessage: message,
|
|
421
|
-
},
|
|
422
|
-
});
|
|
423
|
-
});
|
|
424
|
-
|
|
425
417
|
it('maps the current AskPin passphrase-disabled response without relying on a subcode', async () => {
|
|
426
418
|
const commands = createCommands();
|
|
427
419
|
|
|
@@ -559,51 +551,6 @@ describe('DeviceCommands failure mapping', () => {
|
|
|
559
551
|
}
|
|
560
552
|
);
|
|
561
553
|
|
|
562
|
-
it('maps the Protocol V2 seed-session busy response to DeviceBusy', async () => {
|
|
563
|
-
const commands = createCommands();
|
|
564
|
-
|
|
565
|
-
await expect(
|
|
566
|
-
commands._filterCommonTypes(
|
|
567
|
-
{
|
|
568
|
-
type: 'Failure',
|
|
569
|
-
message: {
|
|
570
|
-
code: 'Failure_ProcessError',
|
|
571
|
-
subcode: DeviceSessionErrorCode.DeviceSessionError_UserCancelled,
|
|
572
|
-
message: 'PIN cancelled',
|
|
573
|
-
},
|
|
574
|
-
} as any,
|
|
575
|
-
'SignTx'
|
|
576
|
-
)
|
|
577
|
-
).rejects.toMatchObject({
|
|
578
|
-
errorCode: HardwareErrorCode.DeviceBusy,
|
|
579
|
-
params: {
|
|
580
|
-
failureCode: 'Failure_ProcessError',
|
|
581
|
-
subcode: DeviceSessionErrorCode.DeviceSessionError_UserCancelled,
|
|
582
|
-
firmwareMessage: 'PIN cancelled',
|
|
583
|
-
},
|
|
584
|
-
});
|
|
585
|
-
});
|
|
586
|
-
|
|
587
|
-
it('keeps the same Protocol V2 response as ActionCancelled for DeviceSession calls', async () => {
|
|
588
|
-
const commands = createCommands();
|
|
589
|
-
|
|
590
|
-
await expect(
|
|
591
|
-
commands._filterCommonTypes(
|
|
592
|
-
{
|
|
593
|
-
type: 'Failure',
|
|
594
|
-
message: {
|
|
595
|
-
code: 'Failure_ProcessError',
|
|
596
|
-
subcode: DeviceSessionErrorCode.DeviceSessionError_UserCancelled,
|
|
597
|
-
message: 'PIN cancelled',
|
|
598
|
-
},
|
|
599
|
-
} as any,
|
|
600
|
-
'DeviceSessionAskPin'
|
|
601
|
-
)
|
|
602
|
-
).rejects.toMatchObject({
|
|
603
|
-
errorCode: HardwareErrorCode.ActionCancelled,
|
|
604
|
-
});
|
|
605
|
-
});
|
|
606
|
-
|
|
607
554
|
it('does not use the legacy cancellation-message fallback for Protocol V1', async () => {
|
|
608
555
|
const commands = createCommands();
|
|
609
556
|
(commands.device.isProtocolV2 as jest.Mock).mockReturnValue(false);
|
|
@@ -3,7 +3,7 @@ import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
|
3
3
|
import { initConnector, initCore } from '../src/core';
|
|
4
4
|
import { DataManager } from '../src/data-manager';
|
|
5
5
|
import TransportManager from '../src/data-manager/TransportManager';
|
|
6
|
-
import { IFRAME
|
|
6
|
+
import { IFRAME } from '../src/events';
|
|
7
7
|
import SearchDevices from '../src/api/SearchDevices';
|
|
8
8
|
import { DeviceList } from '../src/device/DeviceList';
|
|
9
9
|
import { Device } from '../src/device/Device';
|
|
@@ -28,23 +28,6 @@ describe('Core 错误输出边界', () => {
|
|
|
28
28
|
jest.restoreAllMocks();
|
|
29
29
|
});
|
|
30
30
|
|
|
31
|
-
test('entry-point errors preserve USB recovery context across JSON serialization', () => {
|
|
32
|
-
const params = {
|
|
33
|
-
operation: 'open',
|
|
34
|
-
nativeErrorName: 'SecurityError',
|
|
35
|
-
nativeErrorMessage: 'Access denied',
|
|
36
|
-
};
|
|
37
|
-
const error = ERRORS.TypedError(
|
|
38
|
-
HardwareErrorCode.BridgeNeedsPermission,
|
|
39
|
-
'Access denied',
|
|
40
|
-
params
|
|
41
|
-
);
|
|
42
|
-
expect(JSON.parse(JSON.stringify(createErrorMessage(error)))).toEqual({
|
|
43
|
-
success: false,
|
|
44
|
-
payload: { code: HardwareErrorCode.BridgeNeedsPermission, error: 'Access denied', params },
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
|
|
48
31
|
test.each([
|
|
49
32
|
['webusb', false],
|
|
50
33
|
['desktop-webusb', false],
|
|
@@ -125,28 +108,14 @@ describe('Core 错误输出边界', () => {
|
|
|
125
108
|
HardwareErrorCode.BleDeviceBondedCanceled,
|
|
126
109
|
HardwareErrorCode.BleDeviceDisconnected,
|
|
127
110
|
HardwareErrorCode.PollingTimeout,
|
|
128
|
-
HardwareErrorCode.BlePoweredOff,
|
|
129
|
-
HardwareErrorCode.BleUnsupported,
|
|
130
|
-
HardwareErrorCode.BridgeNeedsPermission,
|
|
131
|
-
HardwareErrorCode.WebUsbDeviceAccessError,
|
|
132
111
|
])(
|
|
133
|
-
'preserves terminal
|
|
112
|
+
'preserves terminal BLE error %s in the public response without polling again',
|
|
134
113
|
async errorCode => {
|
|
135
|
-
jest
|
|
136
|
-
.spyOn(DataManager, 'getSettings')
|
|
137
|
-
.mockReturnValue(
|
|
138
|
-
[
|
|
139
|
-
HardwareErrorCode.BridgeNeedsPermission,
|
|
140
|
-
HardwareErrorCode.WebUsbDeviceAccessError,
|
|
141
|
-
].includes(errorCode)
|
|
142
|
-
? ('desktop-webusb' as never)
|
|
143
|
-
: ('react-native' as never)
|
|
144
|
-
);
|
|
114
|
+
jest.spyOn(DataManager, 'getSettings').mockReturnValue('react-native' as never);
|
|
145
115
|
const error = ERRORS.TypedError(errorCode);
|
|
146
116
|
const acquire = jest.fn().mockRejectedValue(error);
|
|
147
117
|
jest.spyOn(TransportManager, 'getTransport').mockReturnValue({
|
|
148
118
|
acquire,
|
|
149
|
-
enumerate: jest.fn().mockResolvedValue([{ path: 'ble-pairing-test' }]),
|
|
150
119
|
release: jest.fn().mockResolvedValue(true),
|
|
151
120
|
stop: jest.fn().mockResolvedValue(undefined),
|
|
152
121
|
} as never);
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
isMissingDetectedProtocolV2Error,
|
|
11
11
|
isRetryableBleConnectionError,
|
|
12
12
|
isRetryableBleProtocolV2ProbeError,
|
|
13
|
+
isTerminalBleStaleBondError,
|
|
13
14
|
resolveBleConnectProtocol,
|
|
14
15
|
} from '../src/core';
|
|
15
16
|
import { DataManager } from '../src/data-manager';
|
|
@@ -610,6 +611,7 @@ describe('public device lifecycle events', () => {
|
|
|
610
611
|
test.each([
|
|
611
612
|
[HardwareErrorCode.RuntimeError, true],
|
|
612
613
|
[HardwareErrorCode.BleDeviceBondError, false],
|
|
614
|
+
[HardwareErrorCode.BlePeerRemovedPairingInformation, false],
|
|
613
615
|
] as const)(
|
|
614
616
|
'retries a Protocol V2 probe mismatch with error code %s: %s',
|
|
615
617
|
(errorCode, expected) => {
|
|
@@ -629,6 +631,8 @@ describe('public device lifecycle events', () => {
|
|
|
629
631
|
[HardwareErrorCode.BleTimeoutError, true],
|
|
630
632
|
[HardwareErrorCode.PollingTimeout, false],
|
|
631
633
|
[HardwareErrorCode.BleDeviceBondError, false],
|
|
634
|
+
[HardwareErrorCode.BlePeerRemovedPairingInformation, false],
|
|
635
|
+
[HardwareErrorCode.BleBondInvalid, false],
|
|
632
636
|
] as const)('retries a BLE connection error with error code %s: %s', (errorCode, expected) => {
|
|
633
637
|
const method = { payload: { connectProtocol: 'V2' } } as never;
|
|
634
638
|
const error = {
|
|
@@ -681,6 +685,19 @@ describe('public device lifecycle events', () => {
|
|
|
681
685
|
}
|
|
682
686
|
);
|
|
683
687
|
|
|
688
|
+
test.each([
|
|
689
|
+
[HardwareErrorCode.BleDeviceBondError, true],
|
|
690
|
+
[HardwareErrorCode.BlePeerRemovedPairingInformation, true],
|
|
691
|
+
[HardwareErrorCode.BleBondInvalid, true],
|
|
692
|
+
[HardwareErrorCode.DeviceNotFound, false],
|
|
693
|
+
] as const)('treats BLE stale-bond error code %s as terminal: %s', (errorCode, expected) => {
|
|
694
|
+
const error = {
|
|
695
|
+
errorCode,
|
|
696
|
+
};
|
|
697
|
+
|
|
698
|
+
expect(isTerminalBleStaleBondError(error)).toBe(expected);
|
|
699
|
+
});
|
|
700
|
+
|
|
684
701
|
test.each([
|
|
685
702
|
[HardwareErrorCode.DeviceCheckDeviceIdError, true],
|
|
686
703
|
[HardwareErrorCode.DeviceNotFound, false],
|
|
@@ -712,48 +729,6 @@ describe('public device lifecycle events', () => {
|
|
|
712
729
|
expect(() => JSON.stringify(disconnectMessage?.payload.device)).not.toThrow();
|
|
713
730
|
});
|
|
714
731
|
|
|
715
|
-
test.each(['V1', 'V2'] as const)(
|
|
716
|
-
'preserves the %s connection identity for a transport disconnect after wipe',
|
|
717
|
-
protocol => {
|
|
718
|
-
jest.spyOn(DataManager, 'getSettings').mockReturnValue('webusb' as never);
|
|
719
|
-
core = initCore();
|
|
720
|
-
initConnector();
|
|
721
|
-
const messages: CoreMessage[] = [];
|
|
722
|
-
core.on(CORE_EVENT, message => messages.push(message));
|
|
723
|
-
const device = createInitializedDevice(protocol);
|
|
724
|
-
const connectId = device.getConnectId();
|
|
725
|
-
DevicePool.devicesCache[connectId] = device;
|
|
726
|
-
|
|
727
|
-
device.invalidateAfterWipe();
|
|
728
|
-
expect(device.toMessageObject()).toBeNull();
|
|
729
|
-
DevicePool.emitter.emit(DEVICE.CONNECT, device);
|
|
730
|
-
expect(messages.some(message => message.type === DEVICE.CONNECT)).toBe(false);
|
|
731
|
-
DevicePool.emitter.emit(TRANSPORT_EVENT.DEVICE_DISCONNECT, { connectId });
|
|
732
|
-
|
|
733
|
-
const disconnects = messages.filter(message => message.type === DEVICE.DISCONNECT);
|
|
734
|
-
expect(disconnects).toHaveLength(1);
|
|
735
|
-
expect(disconnects[0].payload.device).toMatchObject({
|
|
736
|
-
connectId,
|
|
737
|
-
serialNo: 'SERIAL-001',
|
|
738
|
-
deviceId: 'wallet-device-id',
|
|
739
|
-
});
|
|
740
|
-
expect(() => JSON.stringify(disconnects[0].payload.device)).not.toThrow();
|
|
741
|
-
|
|
742
|
-
device.features = {
|
|
743
|
-
...createInitializedDevice(protocol).features,
|
|
744
|
-
deviceId: 'new-device-id',
|
|
745
|
-
initialized: false,
|
|
746
|
-
mode: 'notInitialized',
|
|
747
|
-
} as never;
|
|
748
|
-
DevicePool.emitter.emit(TRANSPORT_EVENT.DEVICE_DISCONNECT, { connectId });
|
|
749
|
-
const nextDisconnects = messages.filter(message => message.type === DEVICE.DISCONNECT);
|
|
750
|
-
expect(nextDisconnects[1].payload.device).toMatchObject({
|
|
751
|
-
deviceId: 'new-device-id',
|
|
752
|
-
mode: 'notInitialized',
|
|
753
|
-
});
|
|
754
|
-
}
|
|
755
|
-
);
|
|
756
|
-
|
|
757
732
|
test('treats an acquired BLE device as reusable until the transport disconnects', async () => {
|
|
758
733
|
jest.spyOn(DataManager, 'getSettings').mockReturnValue('desktop-web-ble' as never);
|
|
759
734
|
const device = createInitializedDevice('V2');
|
|
@@ -1039,28 +1014,6 @@ describe('public device lifecycle events', () => {
|
|
|
1039
1014
|
expect(device.wasInterruptedByUser()).toBe(false);
|
|
1040
1015
|
});
|
|
1041
1016
|
|
|
1042
|
-
test.each(['V1', 'V2'] as const)(
|
|
1043
|
-
'retires a failed USB %s session before the next user attempt',
|
|
1044
|
-
async protocol => {
|
|
1045
|
-
jest.spyOn(DataManager, 'getSettings').mockReturnValue('desktop-webusb' as never);
|
|
1046
|
-
const device = createInitializedDevice(protocol);
|
|
1047
|
-
device.originalDescriptor = { ...device.originalDescriptor, session: device.mainId };
|
|
1048
|
-
const disconnect = jest.fn().mockResolvedValue(undefined);
|
|
1049
|
-
const release = jest.fn().mockResolvedValue(undefined);
|
|
1050
|
-
device.deviceConnector = { disconnect, release } as never;
|
|
1051
|
-
device.commands = { disposed: false, dispose: jest.fn() } as never;
|
|
1052
|
-
(device as unknown as { deviceAcquired: boolean }).deviceAcquired = true;
|
|
1053
|
-
const error = ERRORS.TypedError(HardwareErrorCode.WebUsbDeviceAccessError);
|
|
1054
|
-
await expect(device.run(() => Promise.reject(error))).rejects.toBe(error);
|
|
1055
|
-
await new Promise(resolve => {
|
|
1056
|
-
setImmediate(resolve);
|
|
1057
|
-
});
|
|
1058
|
-
expect(disconnect).toHaveBeenCalledWith(device.mainId);
|
|
1059
|
-
expect(release).toHaveBeenCalledTimes(1);
|
|
1060
|
-
expect(device.hasDeviceAcquire()).toBe(false);
|
|
1061
|
-
}
|
|
1062
|
-
);
|
|
1063
|
-
|
|
1064
1017
|
test('waits for the canceled run to finish releasing before cancellation completes', async () => {
|
|
1065
1018
|
jest.spyOn(DataManager, 'getSettings').mockReturnValue('react-native' as never);
|
|
1066
1019
|
const device = createInitializedDevice('V2');
|
|
@@ -85,56 +85,6 @@ describe('DevicePool state lifecycle', () => {
|
|
|
85
85
|
expect(result.deviceList).toEqual([device]);
|
|
86
86
|
});
|
|
87
87
|
|
|
88
|
-
test.each([
|
|
89
|
-
['V1', undefined],
|
|
90
|
-
['V1', 'wipe-path'],
|
|
91
|
-
['V2', undefined],
|
|
92
|
-
['V2', 'wipe-path'],
|
|
93
|
-
] as const)('rediscovers a wiped %s device with connect id %s', async (protocol, connectId) => {
|
|
94
|
-
const descriptor = { path: 'wipe-path', protocolType: protocol } as never;
|
|
95
|
-
const device = Device.fromDescriptor(descriptor);
|
|
96
|
-
device.features = {
|
|
97
|
-
protocol,
|
|
98
|
-
deviceType: protocol === 'V2' ? 'pro2' : 'classic',
|
|
99
|
-
deviceId: 'old-device-id',
|
|
100
|
-
serialNo: 'wipe-path',
|
|
101
|
-
initialized: true,
|
|
102
|
-
mode: 'normal',
|
|
103
|
-
} as never;
|
|
104
|
-
DevicePool.devicesCache = { 'wipe-path': device };
|
|
105
|
-
device.invalidateAfterWipe();
|
|
106
|
-
expect(device.toMessageObject()).toBeNull();
|
|
107
|
-
const connect = jest.spyOn(device, 'connect').mockResolvedValue(true);
|
|
108
|
-
const initialize = jest.spyOn(device, 'initialize').mockImplementation(() => {
|
|
109
|
-
device.features = {
|
|
110
|
-
protocol,
|
|
111
|
-
deviceType: protocol === 'V2' ? 'pro2' : 'classic',
|
|
112
|
-
deviceId: 'new-device-id',
|
|
113
|
-
serialNo: 'wipe-path',
|
|
114
|
-
initialized: false,
|
|
115
|
-
mode: 'notInitialized',
|
|
116
|
-
} as never;
|
|
117
|
-
return Promise.resolve();
|
|
118
|
-
});
|
|
119
|
-
const release = jest.spyOn(device, 'release').mockResolvedValue(undefined);
|
|
120
|
-
|
|
121
|
-
try {
|
|
122
|
-
const result = await DevicePool.getDevices([descriptor], connectId);
|
|
123
|
-
expect(initialize).toHaveBeenCalledTimes(1);
|
|
124
|
-
expect(connect).toHaveBeenCalledTimes(1);
|
|
125
|
-
expect(release).toHaveBeenCalledTimes(1);
|
|
126
|
-
expect(result.deviceList[0].toMessageObject()).toMatchObject({
|
|
127
|
-
deviceId: 'new-device-id',
|
|
128
|
-
mode: 'notInitialized',
|
|
129
|
-
features: { initialized: false },
|
|
130
|
-
});
|
|
131
|
-
await DevicePool.getDevices([descriptor], connectId);
|
|
132
|
-
expect(initialize).toHaveBeenCalledTimes(1);
|
|
133
|
-
} finally {
|
|
134
|
-
jest.restoreAllMocks();
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
|
|
138
88
|
test('keeps a discovered device when its Protocol V2 label cannot be read', async () => {
|
|
139
89
|
const labelError = new Error('settings unavailable');
|
|
140
90
|
const getDeviceState = jest
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { EDeviceType } from '@onekeyfe/hd-shared';
|
|
2
|
-
|
|
3
1
|
import { Device } from '../src/device/Device';
|
|
4
2
|
import { UI_REQUEST } from '../src/events/ui-request';
|
|
5
3
|
|
|
@@ -25,39 +23,12 @@ const createBootloaderDevice = (protocolType: 'V1' | 'V2') => {
|
|
|
25
23
|
};
|
|
26
24
|
|
|
27
25
|
describe('Pro2 bootloader mode', () => {
|
|
28
|
-
test('
|
|
29
|
-
const device = createBootloaderDevice('V2');
|
|
30
|
-
|
|
31
|
-
expect(device.hasUnexpectedMode([], [])).toBe(UI_REQUEST.BOOTLOADER);
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
test('allows Protocol V2 methods that explicitly support bootloader mode', () => {
|
|
26
|
+
test('does not block Protocol V2 methods in bootloader mode', () => {
|
|
35
27
|
const device = createBootloaderDevice('V2');
|
|
36
28
|
|
|
37
|
-
expect(device.hasUnexpectedMode([
|
|
29
|
+
expect(device.hasUnexpectedMode([], [])).toBeNull();
|
|
38
30
|
});
|
|
39
31
|
|
|
40
|
-
test.each([EDeviceType.Pro2, EDeviceType.Neo])(
|
|
41
|
-
'blocks unsupported Protocol V2 methods in %s romloader mode',
|
|
42
|
-
deviceType => {
|
|
43
|
-
const device = createBootloaderDevice('V2');
|
|
44
|
-
device.updateState(
|
|
45
|
-
{
|
|
46
|
-
protocol: 'V2',
|
|
47
|
-
identity: { deviceType },
|
|
48
|
-
status: { mode: 'romloader', initialized: null },
|
|
49
|
-
},
|
|
50
|
-
'initialize'
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
expect(device.hasUnexpectedMode([], [])).toBe(UI_REQUEST.BOOTLOADER);
|
|
54
|
-
expect(device.hasUnexpectedMode([UI_REQUEST.NOT_INITIALIZE], [])).toBe(UI_REQUEST.BOOTLOADER);
|
|
55
|
-
expect(
|
|
56
|
-
device.hasUnexpectedMode([UI_REQUEST.BOOTLOADER, UI_REQUEST.NOT_INITIALIZE], [])
|
|
57
|
-
).toBeNull();
|
|
58
|
-
}
|
|
59
|
-
);
|
|
60
|
-
|
|
61
32
|
test('keeps the Protocol V1 bootloader restriction', () => {
|
|
62
33
|
const device = createBootloaderDevice('V1');
|
|
63
34
|
|
|
@@ -4991,6 +4991,23 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
4991
4991
|
expect(typedCall.mock.calls.map(call => call[0])).toEqual(['DeviceInfoGet']);
|
|
4992
4992
|
});
|
|
4993
4993
|
|
|
4994
|
+
test('stops V4 bootloader reconnect polling on a stale BLE bond', async () => {
|
|
4995
|
+
const method = new FirmwareUpdateV4({
|
|
4996
|
+
id: 1,
|
|
4997
|
+
payload: {
|
|
4998
|
+
method: 'firmwareUpdateV4',
|
|
4999
|
+
},
|
|
5000
|
+
});
|
|
5001
|
+
const staleBondError = ERRORS.TypedError(HardwareErrorCode.BlePeerRemovedPairingInformation);
|
|
5002
|
+
const reconnectProtocolV2Device = jest.fn().mockRejectedValue(staleBondError);
|
|
5003
|
+
(method as any).reconnectProtocolV2Device = reconnectProtocolV2Device;
|
|
5004
|
+
|
|
5005
|
+
await expect((method as any).waitForProtocolV2BootloaderMode(60_000, 0)).rejects.toBe(
|
|
5006
|
+
staleBondError
|
|
5007
|
+
);
|
|
5008
|
+
expect(reconnectProtocolV2Device).toHaveBeenCalledTimes(1);
|
|
5009
|
+
});
|
|
5010
|
+
|
|
4994
5011
|
test('polls again when Protocol V2 bootloader serial is temporarily unavailable', async () => {
|
|
4995
5012
|
const method = new FirmwareUpdateV4({
|
|
4996
5013
|
id: 1,
|
|
@@ -8992,6 +9009,36 @@ describe('Protocol V2 firmware update targets', () => {
|
|
|
8992
9009
|
);
|
|
8993
9010
|
});
|
|
8994
9011
|
|
|
9012
|
+
test('does not retry or wrap a stale BLE bond during a V4 file transfer', async () => {
|
|
9013
|
+
const method = new FirmwareUpdateV4({
|
|
9014
|
+
id: 1,
|
|
9015
|
+
payload: {
|
|
9016
|
+
method: 'firmwareUpdateV4',
|
|
9017
|
+
},
|
|
9018
|
+
});
|
|
9019
|
+
const staleBondError = ERRORS.TypedError(HardwareErrorCode.BlePeerRemovedPairingInformation);
|
|
9020
|
+
(method as any).fileWriteChunk = jest.fn().mockRejectedValue(staleBondError);
|
|
9021
|
+
const recoverProtocolV2FileTransfer = jest.fn();
|
|
9022
|
+
(method as any).recoverProtocolV2FileTransfer = recoverProtocolV2FileTransfer;
|
|
9023
|
+
const source = await openFirmwareByteSource({
|
|
9024
|
+
binary: new Uint8Array([1]).buffer,
|
|
9025
|
+
});
|
|
9026
|
+
|
|
9027
|
+
try {
|
|
9028
|
+
await expect(
|
|
9029
|
+
(method as any).protocolV2SourceUpdateProcess({
|
|
9030
|
+
source,
|
|
9031
|
+
filePath: 'vol1:firmware.bin',
|
|
9032
|
+
processedSize: 0,
|
|
9033
|
+
totalSize: 1,
|
|
9034
|
+
})
|
|
9035
|
+
).rejects.toBe(staleBondError);
|
|
9036
|
+
} finally {
|
|
9037
|
+
await source?.close();
|
|
9038
|
+
}
|
|
9039
|
+
expect(recoverProtocolV2FileTransfer).not.toHaveBeenCalled();
|
|
9040
|
+
});
|
|
9041
|
+
|
|
8995
9042
|
test('does not recover or wrap a cancelled V4 file transfer', async () => {
|
|
8996
9043
|
const method = new FirmwareUpdateV4({
|
|
8997
9044
|
id: 1,
|
|
@@ -73,26 +73,24 @@ describe('live device state reads', () => {
|
|
|
73
73
|
}
|
|
74
74
|
);
|
|
75
75
|
|
|
76
|
-
test
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
};
|
|
76
|
+
test('rejects settings scope in loader mode after minimal mode detection', async () => {
|
|
77
|
+
const getDeviceState = jest.fn().mockResolvedValue({ status: { mode: 'bootloader' } });
|
|
78
|
+
const method = new GetDeviceState({
|
|
79
|
+
id: 1,
|
|
80
|
+
payload: { method: 'getDeviceState', scope: 'settings' },
|
|
81
|
+
});
|
|
82
|
+
method.init();
|
|
83
|
+
(method as any).device = {
|
|
84
|
+
isProtocolV2: () => true,
|
|
85
|
+
getCurrentFirmwareType: () => 'universal',
|
|
86
|
+
getDeviceState,
|
|
87
|
+
};
|
|
89
88
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
);
|
|
89
|
+
await expect(method.run()).rejects.toMatchObject({
|
|
90
|
+
errorCode: HardwareErrorCode.DeviceNotSupportMethod,
|
|
91
|
+
});
|
|
92
|
+
expect(getDeviceState).toHaveBeenCalledWith({ refreshSections: ['status', 'settings'] });
|
|
93
|
+
});
|
|
96
94
|
|
|
97
95
|
test('rejects an unknown scope', () => {
|
|
98
96
|
const method = new GetDeviceState({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FirmwareUpdateV4.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV4.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"FirmwareUpdateV4.d.ts","sourceRoot":"","sources":["../../src/api/FirmwareUpdateV4.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EAMZ,MAAM,qBAAqB,CAAC;AA0B7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAiC/E,OAAO,KAAK,EAEV,sBAAsB,EAEvB,MAAM,6BAA6B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,OAAO,CAAC,0BAA0B;YAkBpB,mCAAmC;YAWnC,qCAAqC;YAmDrC,yBAAyB;YAgGzB,8BAA8B;IAU5C,OAAO,CAAC,kCAAkC;YAQ5B,cAAc;YAyCd,6BAA6B;YAW7B,0BAA0B;YAoB1B,6BAA6B;YAwD7B,gBAAgB;IA0B9B,OAAO,CAAC,qBAAqB;CAM9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetDeviceState.d.ts","sourceRoot":"","sources":["../../src/api/GetDeviceState.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,KAAK,EAAoB,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAU1F,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CACpD,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,CAC9C;IACC,qBAAqB;IAIrB,IAAI;IAmBE,GAAG;
|
|
1
|
+
{"version":3,"file":"GetDeviceState.d.ts","sourceRoot":"","sources":["../../src/api/GetDeviceState.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,KAAK,EAAoB,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAU1F,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,UAAU,CACpD,QAAQ,CAAC,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC,CAC9C;IACC,qBAAqB;IAIrB,IAAI;IAmBE,GAAG;CAgBV"}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare function getPostCallPendingPromise(method: BaseMethod, device: De
|
|
|
12
12
|
export declare function isRetryableBleProtocolV2ProbeError(method: BaseMethod, error: unknown): boolean;
|
|
13
13
|
export declare function isRetryableBleConnectionError(method: BaseMethod, error: unknown): boolean;
|
|
14
14
|
export declare function isMissingDetectedProtocolV2Error(method: BaseMethod, error: unknown): boolean;
|
|
15
|
+
export declare function isTerminalBleStaleBondError(error: unknown): boolean;
|
|
15
16
|
export declare function isDeviceIdentityMismatchError(error: unknown): boolean;
|
|
16
17
|
export declare function resolveBleConnectProtocol(method: BaseMethod): ProtocolType | undefined;
|
|
17
18
|
export declare const cancel: (context: CoreContext, connectId?: string) => void;
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAEL,KAAK,6BAA6B,EAElC,KAAK,YAAY,EAIlB,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";AACA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAClC,OAAO,EAEL,KAAK,6BAA6B,EAElC,KAAK,YAAY,EAIlB,MAAM,wBAAwB,CAAC;AAiChC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAsB1C,OAAO,eAAe,MAAM,2BAA2B,CAAC;AAYxD,OAAO,KAAK,EAAE,eAAe,EAAyB,MAAM,UAAU,CAAC;AACvE,OAAO,KAAK,EAAE,WAAW,EAAmD,MAAM,WAAW,CAAC;AAI9F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAYpD,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;AA0E7D,eAAO,MAAM,OAAO,YAAmB,WAAW,WAAW,WAAW,iBA0FvE,CAAC;AA2FF,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAY3F;AAunBD,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,WAWpF;AAED,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,WAoB/E;AAED,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,WAQlF;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,WAEzD;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,OAAO,WAI3D;AAiKD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,UAAU,GAAG,YAAY,GAAG,SAAS,CAMtF;AA2MD,eAAO,MAAM,MAAM,YAAa,WAAW,cAAc,MAAM,SA4G9D,CAAC;AA8GF,eAAO,MAAM,qBAAqB,gFAejC,CAAC;AAiLF,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,YAAY;IAC5C,OAAO,CAAC,cAAc,CAAoB;IAE1C,SAAgB,aAAa,EAAE,MAAM,CAAC;IAEtC,OAAO,CAAC,YAAY,CAAsB;IAE1C,OAAO,CAAC,cAAc,CAAC,CAAgB;IAGvC,OAAO,CAAC,sBAAsB,CAAoC;IAElE,OAAO,CAAC,iBAAiB,CAAoB;;IAS7C,OAAO,CAAC,cAAc;IAuChB,aAAa,CAAC,OAAO,EAAE,WAAW;IAuExC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;YAOV,gBAAgB;CAiC/B;AAED,eAAO,MAAM,QAAQ,YAIpB,CAAC;AAEF,eAAO,MAAM,aAAa,uBAYzB,CAAC;AAMF,eAAO,MAAM,IAAI,aACL,eAAe,aACd,GAAG,WACL,6BAA6B,8BAiBvC,CAAC;AAEF,eAAO,MAAM,eAAe;SAKrB,eAAe,CAAC,KAAK,CAAC;eAChB,GAAG;;UASf,CAAC"}
|
package/dist/device/Device.d.ts
CHANGED
|
@@ -70,7 +70,6 @@ export declare class Device extends EventEmitter {
|
|
|
70
70
|
private connectionAttempt;
|
|
71
71
|
private interruptedAttempt;
|
|
72
72
|
private stateStore;
|
|
73
|
-
private deviceBeforeWipe;
|
|
74
73
|
private protocolV2StateNeedsReload;
|
|
75
74
|
private protocolV2RuntimeContext?;
|
|
76
75
|
private protocolV2RuntimeContextPromise?;
|
|
@@ -99,7 +98,6 @@ export declare class Device extends EventEmitter {
|
|
|
99
98
|
constructor(descriptor: DeviceDescriptor, sdkInstanceId?: string);
|
|
100
99
|
static fromDescriptor(originalDescriptor: DeviceDescriptor, sdkInstanceId?: string): Device;
|
|
101
100
|
toMessageObject(): DeviceTyped | null;
|
|
102
|
-
toDisconnectMessageObject(): DeviceTyped | null;
|
|
103
101
|
connect(connectProtocol?: HardwareConnectProtocol, options?: {
|
|
104
102
|
forceProtocolDetection?: boolean;
|
|
105
103
|
}): Promise<boolean>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Device.d.ts","sourceRoot":"","sources":["../../src/device/Device.ts"],"names":[],"mappings":";AAAA,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAmB,MAAM,wBAAwB,CAAC;AACjG,OAAO,EAEL,aAAa,EASd,MAAM,qBAAqB,CAAC;AAU7B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAalD,OAAO,EACL,KAAK,mBAAmB,EAExB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAE5B,KAAK,MAAM,IAAI,WAAW,EAC1B,iBAAiB,EACjB,KAAK,QAAQ,EACb,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC7B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,MAAM,EAAc,MAAM,WAAW,CAAC;AAI/C,OAAO,EAKL,KAAK,qBAAqB,EAO3B,MAAM,mCAAmC,CAAC;AAI3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,KAAK,EA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BAA6B,CAC3B,OAAO,CAAC,EAAE,yBAAyB,CAAC,SAAS,CAAC,EAC9C,OAAO,CAAC,EAAE;QAAE,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE;IAwBxC,8BAA8B;IAI9B,yBAAyB,IAAI,mBAAmB;IAS1C,YAAY,CAChB,OAAO,CAAC,EAAE,oBAAoB,EAC9B,OAAO,CAAC,EAAE,yBAAyB,GAAG;QAAE,WAAW,CAAC,EAAE,OAAO,CAAA;KAAE;IAmG3D,0BAA0B,CAC9B,eAAe,CAAC,EAAE,MAAM,EACxB,kBAAkB,CAAC,EAAE,OAAO,EAC5B,mBAAmB,CAAC,EAAE,OAAO,EAC7B,aAAa,CAAC,EAAE,OAAO,EACvB,eAAe,CAAC,EAAE,OAAO;CA0D5B;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -31,7 +31,7 @@ export declare const cancelDeviceInPrompt: (device: Device, expectResponse?: boo
|
|
|
31
31
|
};
|
|
32
32
|
} | {
|
|
33
33
|
success: boolean;
|
|
34
|
-
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 830 | 831 | 832 | 900 | 901 | 902
|
|
34
|
+
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 830 | 831 | 832 | 900 | 901 | 902;
|
|
35
35
|
payload: {
|
|
36
36
|
message: string;
|
|
37
37
|
};
|
|
@@ -50,7 +50,7 @@ export declare const cancelDeviceWithInitialize: (device: Device) => Promise<{
|
|
|
50
50
|
};
|
|
51
51
|
} | {
|
|
52
52
|
success: boolean;
|
|
53
|
-
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 830 | 831 | 832 | 900 | 901 | 902
|
|
53
|
+
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 830 | 831 | 832 | 900 | 901 | 902;
|
|
54
54
|
payload: {
|
|
55
55
|
message: string;
|
|
56
56
|
};
|
|
@@ -81,7 +81,7 @@ export declare class DeviceCommands {
|
|
|
81
81
|
};
|
|
82
82
|
} | {
|
|
83
83
|
success: boolean;
|
|
84
|
-
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 830 | 831 | 832 | 900 | 901 | 902
|
|
84
|
+
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 830 | 831 | 832 | 900 | 901 | 902;
|
|
85
85
|
payload: {
|
|
86
86
|
message: string;
|
|
87
87
|
};
|
|
@@ -100,7 +100,7 @@ export declare class DeviceCommands {
|
|
|
100
100
|
};
|
|
101
101
|
} | {
|
|
102
102
|
success: boolean;
|
|
103
|
-
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 830 | 831 | 832 | 900 | 901 | 902
|
|
103
|
+
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 830 | 831 | 832 | 900 | 901 | 902;
|
|
104
104
|
payload: {
|
|
105
105
|
message: string;
|
|
106
106
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeviceCommands.d.ts","sourceRoot":"","sources":["../../src/device/DeviceCommands.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,oBAAoB,EAG1B,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EAAU,KAAK,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAQlE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,KAAK,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;AACxC,KAAK,UAAU,GAAG,OAAO,CAAC,MAAM,WAAW,EAAE,MAAM,CAAC,CAAC;AACrD,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,UAAU,IAAI;IACvD,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;CACzB,CAAC;AACF,KAAK,oB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AC,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,WAAW;WA0B9D,gCAAgC,CAAC,MAAM,EAAE,MAAM;WAa/C,gBAAgB,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,MAAM;WAK9D,mBAAmB,CAAC,WAAW,CAAC,EAAE,WAAW,EAAE,SAAS,CAAC,EAAE,MAAM;IAY9E,MAAM,CAAC,sBAAsB;IAY7B,MAAM,CAAC,kBAAkB,CAAC,QAAQ,EAAE,gBAAgB,EAAE;IAsCtD,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM;IAOnC,MAAM,CAAC,yBAAyB,CAAC,UAAU,EAAE,gBAAgB;IAU7D,MAAM,CAAC,8BAA8B,CAAC,IAAI,EAAE,MAAM;IAOlD,MAAM,CAAC,4BAA4B,CAAC,UAAU,EAAE,gBAAgB;IAUhE,MAAM,CAAC,UAAU;IAUjB,MAAM,CAAC,OAAO;CAIf"}
|
package/dist/index.d.ts
CHANGED
|
@@ -82,7 +82,6 @@ interface Unsuccessful {
|
|
|
82
82
|
payload: {
|
|
83
83
|
error: string;
|
|
84
84
|
code?: string | number;
|
|
85
|
-
params?: Record<string, unknown>;
|
|
86
85
|
};
|
|
87
86
|
}
|
|
88
87
|
interface Success<T> {
|
|
@@ -145,7 +144,7 @@ declare class DeviceCommands {
|
|
|
145
144
|
};
|
|
146
145
|
} | {
|
|
147
146
|
success: boolean;
|
|
148
|
-
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 830 | 831 | 832 | 900 | 901 | 902
|
|
147
|
+
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 830 | 831 | 832 | 900 | 901 | 902;
|
|
149
148
|
payload: {
|
|
150
149
|
message: string;
|
|
151
150
|
};
|
|
@@ -164,7 +163,7 @@ declare class DeviceCommands {
|
|
|
164
163
|
};
|
|
165
164
|
} | {
|
|
166
165
|
success: boolean;
|
|
167
|
-
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 830 | 831 | 832 | 900 | 901 | 902
|
|
166
|
+
error: 0 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 200 | 300 | 301 | 302 | 303 | 304 | 305 | 400 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 500 | 600 | 601 | 602 | 603 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 830 | 831 | 832 | 900 | 901 | 902;
|
|
168
167
|
payload: {
|
|
169
168
|
message: string;
|
|
170
169
|
};
|
|
@@ -822,8 +821,6 @@ declare class Device extends EventEmitter {
|
|
|
822
821
|
private interruptedAttempt;
|
|
823
822
|
/** Canonical device-state cache; legacy Features is a compatibility projection. */
|
|
824
823
|
private stateStore;
|
|
825
|
-
/** Retain the old public identity only for disconnect notifications after wipe. */
|
|
826
|
-
private deviceBeforeWipe;
|
|
827
824
|
/** Force the next initialization to reload DeviceInfo after reconnect or reboot. */
|
|
828
825
|
private protocolV2StateNeedsReload;
|
|
829
826
|
/** Runtime context negotiated once per active Protocol V2 link. */
|
|
@@ -863,7 +860,6 @@ declare class Device extends EventEmitter {
|
|
|
863
860
|
constructor(descriptor: OneKeyDeviceInfo, sdkInstanceId?: string);
|
|
864
861
|
static fromDescriptor(originalDescriptor: OneKeyDeviceInfo, sdkInstanceId?: string): Device;
|
|
865
862
|
toMessageObject(): Device$1 | null;
|
|
866
|
-
toDisconnectMessageObject(): Device$1 | null;
|
|
867
863
|
/**
|
|
868
864
|
* Device connect
|
|
869
865
|
* @returns {Promise<boolean>}
|
package/dist/index.js
CHANGED
|
@@ -41534,7 +41534,7 @@ const parseMessage = (messageData) => {
|
|
|
41534
41534
|
const createErrorMessage = (error) => {
|
|
41535
41535
|
let payload = { error: error.message, code: error.code };
|
|
41536
41536
|
if (error instanceof hdShared.HardwareError) {
|
|
41537
|
-
payload = { error: error.message, code: error.errorCode
|
|
41537
|
+
payload = { error: error.message, code: error.errorCode };
|
|
41538
41538
|
}
|
|
41539
41539
|
return {
|
|
41540
41540
|
success: false,
|
|
@@ -43466,9 +43466,7 @@ class DevicePool extends events.exports {
|
|
|
43466
43466
|
const exist = canPathIdentifyDevice(cachedPath)
|
|
43467
43467
|
? descriptorList.find(d => d.path === cachedPath)
|
|
43468
43468
|
: undefined;
|
|
43469
|
-
if (exist &&
|
|
43470
|
-
!(initOptions === null || initOptions === void 0 ? void 0 : initOptions.forceProtocolDetection) &&
|
|
43471
|
-
!(device.needReloadDevice && device.isUnacquired())) {
|
|
43469
|
+
if (exist && !(initOptions === null || initOptions === void 0 ? void 0 : initOptions.forceProtocolDetection)) {
|
|
43472
43470
|
device.updateDescriptor(exist, true);
|
|
43473
43471
|
yield this._refreshRuntimeState(device, initOptions);
|
|
43474
43472
|
devices[connectId] = device;
|
|
@@ -43524,11 +43522,7 @@ class DevicePool extends events.exports {
|
|
|
43524
43522
|
const forceProtocolDetection = (initOptions === null || initOptions === void 0 ? void 0 : initOptions.forceProtocolDetection) === true;
|
|
43525
43523
|
const isNewDevice = !cachedDevice;
|
|
43526
43524
|
const device = cachedDevice !== null && cachedDevice !== void 0 ? cachedDevice : Device.fromDescriptor(descriptor);
|
|
43527
|
-
if (isNewDevice ||
|
|
43528
|
-
forceProtocolDetection ||
|
|
43529
|
-
(device.needReloadDevice && device.isUnacquired())) {
|
|
43530
|
-
if (cachedDevice)
|
|
43531
|
-
device.updateDescriptor(descriptor, true);
|
|
43525
|
+
if (isNewDevice || forceProtocolDetection) {
|
|
43532
43526
|
device.deviceConnector = this.connector;
|
|
43533
43527
|
(_a = device.beginConnectionAttempt) === null || _a === void 0 ? void 0 : _a.call(device);
|
|
43534
43528
|
if (forceProtocolDetection && !isNewDevice) {
|
|
@@ -44215,12 +44209,6 @@ class DeviceCommands {
|
|
|
44215
44209
|
const isProtocolV2DeviceBusyFailure = this.device.isProtocolV2() &&
|
|
44216
44210
|
DEVICE_CONTROL_CALLS.has(callType) &&
|
|
44217
44211
|
subcode === hdTransport.DeviceErrorCode.DeviceError_Busy;
|
|
44218
|
-
const isProtocolV2PinCancelledBusyFailure = this.device.isProtocolV2() &&
|
|
44219
|
-
!DEVICE_SESSION_CALLS.has(callType) &&
|
|
44220
|
-
subcode === hdTransport.DeviceSessionErrorCode.DeviceSessionError_UserCancelled &&
|
|
44221
|
-
/^pin cancelled$/i.test(normalizedMessage);
|
|
44222
|
-
const isProtocolV2FirmwareUpdateBusyFailure = this.device.isProtocolV2() &&
|
|
44223
|
-
/^requested command not allowed while a firmware update is in progress$/i.test(normalizedMessage);
|
|
44224
44212
|
const isLegacyProtocolV2LockedFailure = this.device.isProtocolV2() && /^device (?:is )?locked$/i.test(normalizedMessage);
|
|
44225
44213
|
if (DEVICE_SESSION_CALLS.has(callType) &&
|
|
44226
44214
|
subcode === hdTransport.DeviceSessionErrorCode.DeviceSessionError_InvalidSession) {
|
|
@@ -44271,9 +44259,7 @@ class DeviceCommands {
|
|
|
44271
44259
|
firmwareMessage: message,
|
|
44272
44260
|
});
|
|
44273
44261
|
}
|
|
44274
|
-
else if (isProtocolV2DeviceBusyFailure
|
|
44275
|
-
isProtocolV2PinCancelledBusyFailure ||
|
|
44276
|
-
isProtocolV2FirmwareUpdateBusyFailure) {
|
|
44262
|
+
else if (isProtocolV2DeviceBusyFailure) {
|
|
44277
44263
|
error = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceBusy, message, {
|
|
44278
44264
|
failureCode: code,
|
|
44279
44265
|
subcode,
|
|
@@ -45500,7 +45486,6 @@ class Device extends events.exports {
|
|
|
45500
45486
|
this.connectionAttempt = 0;
|
|
45501
45487
|
this.interruptedAttempt = null;
|
|
45502
45488
|
this.stateStore = new DeviceStateStore();
|
|
45503
|
-
this.deviceBeforeWipe = null;
|
|
45504
45489
|
this.protocolV2StateNeedsReload = false;
|
|
45505
45490
|
this.protocolV2UiInteractionCounter = 0;
|
|
45506
45491
|
this.externalState = [];
|
|
@@ -45524,7 +45509,6 @@ class Device extends events.exports {
|
|
|
45524
45509
|
var _a;
|
|
45525
45510
|
if (this.isUnacquired() || !this.features)
|
|
45526
45511
|
return null;
|
|
45527
|
-
this.deviceBeforeWipe = null;
|
|
45528
45512
|
const env = DataManager.getSettings('env');
|
|
45529
45513
|
const deviceType = this.getCurrentDeviceType();
|
|
45530
45514
|
const bleName = this.getCurrentBleName();
|
|
@@ -45558,10 +45542,6 @@ class Device extends events.exports {
|
|
|
45558
45542
|
unavailableCapabilities: this.unavailableCapabilities,
|
|
45559
45543
|
};
|
|
45560
45544
|
}
|
|
45561
|
-
toDisconnectMessageObject() {
|
|
45562
|
-
var _a;
|
|
45563
|
-
return (_a = this.toMessageObject()) !== null && _a !== void 0 ? _a : this.deviceBeforeWipe;
|
|
45564
|
-
}
|
|
45565
45545
|
connect(connectProtocol, options) {
|
|
45566
45546
|
const env = DataManager.getSettings('env');
|
|
45567
45547
|
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -46313,8 +46293,6 @@ class Device extends events.exports {
|
|
|
46313
46293
|
this.invalidateProtocolV2RuntimeState();
|
|
46314
46294
|
}
|
|
46315
46295
|
invalidateAfterWipe() {
|
|
46316
|
-
var _a;
|
|
46317
|
-
this.deviceBeforeWipe = (_a = this.toMessageObject()) !== null && _a !== void 0 ? _a : this.deviceBeforeWipe;
|
|
46318
46296
|
const deviceId = this.getCurrentDeviceId();
|
|
46319
46297
|
if (deviceId) {
|
|
46320
46298
|
deviceWalletSessionStore.deleteDevice(deviceId);
|
|
@@ -46683,7 +46661,7 @@ class Device extends events.exports {
|
|
|
46683
46661
|
}
|
|
46684
46662
|
hasUnexpectedMode(allow, require) {
|
|
46685
46663
|
if (!this.isUnacquired()) {
|
|
46686
|
-
if (
|
|
46664
|
+
if (this.isBootloader() && !this.isProtocolV2() && !allow.includes(UI_REQUEST.BOOTLOADER)) {
|
|
46687
46665
|
return UI_REQUEST.BOOTLOADER;
|
|
46688
46666
|
}
|
|
46689
46667
|
if (!this.isInitialized() && !allow.includes(UI_REQUEST.NOT_INITIALIZE)) {
|
|
@@ -47494,7 +47472,7 @@ class GetDeviceState extends BaseMethod {
|
|
|
47494
47472
|
if (this.params.scope === 'settings' &&
|
|
47495
47473
|
this.device.isProtocolV2() &&
|
|
47496
47474
|
isLoaderMode(state.status.mode)) {
|
|
47497
|
-
throw hdShared.
|
|
47475
|
+
throw hdShared.createDeviceNotSupportMethodError(`${this.name}:${this.params.scope}`, this.device.getCurrentFirmwareType());
|
|
47498
47476
|
}
|
|
47499
47477
|
return state;
|
|
47500
47478
|
});
|
|
@@ -52613,11 +52591,12 @@ const getProtocolV2ErrorCode = (error) => {
|
|
|
52613
52591
|
};
|
|
52614
52592
|
const isProtocolV2TerminalInstallStatusError = (error) => {
|
|
52615
52593
|
var _a;
|
|
52616
|
-
return
|
|
52617
|
-
(error
|
|
52618
|
-
error.errorCode === hdShared.HardwareErrorCode.
|
|
52619
|
-
|
|
52620
|
-
|
|
52594
|
+
return hdShared.isBleStaleBondHardwareError(error) ||
|
|
52595
|
+
(error instanceof hdShared.HardwareError &&
|
|
52596
|
+
(error.errorCode === hdShared.HardwareErrorCode.ActionCancelled ||
|
|
52597
|
+
error.errorCode === hdShared.HardwareErrorCode.FirmwareError ||
|
|
52598
|
+
error.errorCode === hdShared.HardwareErrorCode.FirmwareVerificationFailed ||
|
|
52599
|
+
((_a = error.params) === null || _a === void 0 ? void 0 : _a.firmwareUpdateCode) === PROTOCOL_V2_INSTALL_STATUS_CONFLICT_CODE));
|
|
52621
52600
|
};
|
|
52622
52601
|
const isProtocolV2TargetStatusFinished = (status) => normalizeProtocolV2TargetStatus(status) === PROTOCOL_V2_TARGET_STATUS_FINISHED;
|
|
52623
52602
|
const isProtocolV2TargetStatusInProgress = (status) => normalizeProtocolV2TargetStatus(status) === PROTOCOL_V2_TARGET_STATUS_PENDING ||
|
|
@@ -53711,6 +53690,9 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53711
53690
|
return true;
|
|
53712
53691
|
}
|
|
53713
53692
|
catch (error) {
|
|
53693
|
+
if (hdShared.isBleStaleBondHardwareError(error)) {
|
|
53694
|
+
throw error;
|
|
53695
|
+
}
|
|
53714
53696
|
Log$6.log(`[FirmwareUpdateV4] RESC bundle ${bundle.name} header check failed: `, error);
|
|
53715
53697
|
return false;
|
|
53716
53698
|
}
|
|
@@ -53795,7 +53777,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
53795
53777
|
lastError = new Error('Protocol V2 device is reachable but is not in bootloader mode');
|
|
53796
53778
|
}
|
|
53797
53779
|
catch (error) {
|
|
53798
|
-
if (this.isProtocolV2ReconnectIdentityError(error)) {
|
|
53780
|
+
if (hdShared.isBleStaleBondHardwareError(error) || this.isProtocolV2ReconnectIdentityError(error)) {
|
|
53799
53781
|
throw error;
|
|
53800
53782
|
}
|
|
53801
53783
|
shouldReconnect = true;
|
|
@@ -54012,6 +53994,9 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
54012
53994
|
}
|
|
54013
53995
|
catch (error) {
|
|
54014
53996
|
this.throwIfAborted();
|
|
53997
|
+
if (hdShared.isBleStaleBondHardwareError(error)) {
|
|
53998
|
+
throw error;
|
|
53999
|
+
}
|
|
54015
54000
|
lastError = error;
|
|
54016
54001
|
if (attempt < PROTOCOL_V2_FILE_TRANSFER_RETRY_COUNT) {
|
|
54017
54002
|
yield this.recoverProtocolV2FileTransfer();
|
|
@@ -54500,6 +54485,9 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
54500
54485
|
}
|
|
54501
54486
|
}
|
|
54502
54487
|
catch (error) {
|
|
54488
|
+
if (hdShared.isBleStaleBondHardwareError(error)) {
|
|
54489
|
+
throw error;
|
|
54490
|
+
}
|
|
54503
54491
|
Log$6.log('[FirmwareUpdateV4] unable to confirm App mode before Normal reboot: ', error);
|
|
54504
54492
|
}
|
|
54505
54493
|
yield this.protocolV2Reboot(hdTransport.DeviceRebootType.Normal);
|
|
@@ -54574,7 +54562,7 @@ class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod {
|
|
|
54574
54562
|
lastError = hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.DeviceNotFound, 'Protocol V2 device is still in bootloader mode');
|
|
54575
54563
|
}
|
|
54576
54564
|
catch (error) {
|
|
54577
|
-
if (this.isProtocolV2ReconnectIdentityError(error)) {
|
|
54565
|
+
if (hdShared.isBleStaleBondHardwareError(error) || this.isProtocolV2ReconnectIdentityError(error)) {
|
|
54578
54566
|
throw error;
|
|
54579
54567
|
}
|
|
54580
54568
|
shouldReconnect = true;
|
|
@@ -66695,6 +66683,9 @@ function isMissingDetectedProtocolV2Error(method, error) {
|
|
|
66695
66683
|
typeof typedError.message === 'string' &&
|
|
66696
66684
|
typedError.message.includes('Device protocol has not been detected'));
|
|
66697
66685
|
}
|
|
66686
|
+
function isTerminalBleStaleBondError(error) {
|
|
66687
|
+
return hdShared.isBleStaleBondHardwareError(error);
|
|
66688
|
+
}
|
|
66698
66689
|
function isDeviceIdentityMismatchError(error) {
|
|
66699
66690
|
return ((error === null || error === void 0 ? void 0 : error.errorCode) === hdShared.HardwareErrorCode.DeviceCheckDeviceIdError);
|
|
66700
66691
|
}
|
|
@@ -66859,7 +66850,6 @@ const ensureConnected = (_context, method, connectId, pollingId, abortSignal) =>
|
|
|
66859
66850
|
hdShared.HardwareErrorCode.BridgeNotInstalled,
|
|
66860
66851
|
hdShared.HardwareErrorCode.BridgeTimeoutError,
|
|
66861
66852
|
hdShared.HardwareErrorCode.BridgeNeedsPermission,
|
|
66862
|
-
hdShared.HardwareErrorCode.WebUsbDeviceAccessError,
|
|
66863
66853
|
].includes(error.errorCode)) {
|
|
66864
66854
|
_deviceList = undefined;
|
|
66865
66855
|
reject(error);
|
|
@@ -66934,12 +66924,12 @@ const ensureConnected = (_context, method, connectId, pollingId, abortSignal) =>
|
|
|
66934
66924
|
hdShared.HardwareErrorCode.DeviceDetectInBootloaderMode,
|
|
66935
66925
|
hdShared.HardwareErrorCode.BleCharacteristicNotifyChangeFailure,
|
|
66936
66926
|
hdShared.HardwareErrorCode.BridgeNeedsPermission,
|
|
66937
|
-
hdShared.HardwareErrorCode.WebUsbDeviceAccessError,
|
|
66938
66927
|
hdShared.HardwareErrorCode.DeviceInterruptedFromUser,
|
|
66939
66928
|
hdShared.HardwareErrorCode.CallQueueActionCancelled,
|
|
66940
66929
|
].includes(error.errorCode) ||
|
|
66941
66930
|
(env === 'react-native' &&
|
|
66942
66931
|
[hdShared.HardwareErrorCode.BleDeviceDisconnected, hdShared.HardwareErrorCode.PollingTimeout].includes(error.errorCode)) ||
|
|
66932
|
+
isTerminalBleStaleBondError(error) ||
|
|
66943
66933
|
isDeviceIdentityMismatchError(error)) {
|
|
66944
66934
|
reject(error);
|
|
66945
66935
|
return;
|
|
@@ -67099,7 +67089,7 @@ const onDeviceConnectHandler = (device) => {
|
|
|
67099
67089
|
};
|
|
67100
67090
|
const onDeviceDisconnectHandler = (device) => {
|
|
67101
67091
|
device.clearPreInitialized();
|
|
67102
|
-
const deviceObject = device.
|
|
67092
|
+
const deviceObject = device.toMessageObject();
|
|
67103
67093
|
if (!deviceObject)
|
|
67104
67094
|
return;
|
|
67105
67095
|
postMessage(createDeviceMessage(DEVICE.DISCONNECT, { device: deviceObject }));
|
package/dist/types/params.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../src/types/params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE,MAAM,WAAW,YAAY;IAQ3B,WAAW,CAAC,EAAE,OAAO,CAAC;IAItB,UAAU,CAAC,EAAE,MAAM,CAAC;IAIpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAI1B,OAAO,CAAC,EAAE,MAAM,CAAC;IAIjB,6BAA6B,CAAC,EAAE,MAAM,CAAC;IAIvC,eAAe,CAAC,EAAE,MAAM,CAAC;IAIzB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAI7B,WAAW,CAAC,EAAE,OAAO,CAAC;IAKtB,aAAa,CAAC,EAAE,OAAO,CAAC;IAGxB,sBAAsB,CAAC,EAAE,OAAO,CAAC;IAKjC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAK9B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAK9B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAK/B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAM3B,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAM1C,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,YAAY,GAAG,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC;AAElE,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,KAAK,CAAC;IACf,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../src/types/params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAEnE,MAAM,WAAW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
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"description": "Core processes and APIs for communicating with OneKey hardware devices.",
|
|
5
5
|
"author": "OneKey",
|
|
6
6
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"url": "https://github.com/OneKeyHQ/hardware-js-sdk/issues"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@onekeyfe/hd-shared": "1.2.8
|
|
29
|
-
"@onekeyfe/hd-transport": "1.2.8
|
|
28
|
+
"@onekeyfe/hd-shared": "1.2.8",
|
|
29
|
+
"@onekeyfe/hd-transport": "1.2.8",
|
|
30
30
|
"axios": "1.15.2",
|
|
31
31
|
"bignumber.js": "^9.0.2",
|
|
32
32
|
"buffer": "^6.0.3",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"@types/w3c-web-usb": "^1.0.10",
|
|
47
47
|
"@types/web-bluetooth": "^0.0.21"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "9f016278a7f395bf66b8502815dc63191e162fd3"
|
|
50
50
|
}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
EDeviceType,
|
|
3
|
+
ERRORS,
|
|
4
|
+
HardwareError,
|
|
5
|
+
HardwareErrorCode,
|
|
6
|
+
isBleStaleBondHardwareError,
|
|
7
|
+
wait,
|
|
8
|
+
} from '@onekeyfe/hd-shared';
|
|
2
9
|
import JSZip from 'jszip';
|
|
3
10
|
import {
|
|
4
11
|
DeviceRebootType,
|
|
@@ -386,11 +393,12 @@ const getProtocolV2ErrorCode = (error: unknown): number | string | undefined =>
|
|
|
386
393
|
};
|
|
387
394
|
|
|
388
395
|
const isProtocolV2TerminalInstallStatusError = (error: unknown) =>
|
|
389
|
-
error
|
|
390
|
-
(error
|
|
391
|
-
error.errorCode === HardwareErrorCode.
|
|
392
|
-
|
|
393
|
-
|
|
396
|
+
isBleStaleBondHardwareError(error) ||
|
|
397
|
+
(error instanceof HardwareError &&
|
|
398
|
+
(error.errorCode === HardwareErrorCode.ActionCancelled ||
|
|
399
|
+
error.errorCode === HardwareErrorCode.FirmwareError ||
|
|
400
|
+
error.errorCode === HardwareErrorCode.FirmwareVerificationFailed ||
|
|
401
|
+
error.params?.firmwareUpdateCode === PROTOCOL_V2_INSTALL_STATUS_CONFLICT_CODE));
|
|
394
402
|
|
|
395
403
|
const isProtocolV2TargetStatusFinished = (status: ProtocolV2FirmwareUpdateStatusTarget['status']) =>
|
|
396
404
|
normalizeProtocolV2TargetStatus(status) === PROTOCOL_V2_TARGET_STATUS_FINISHED;
|
|
@@ -1872,6 +1880,9 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
1872
1880
|
if (!expectedHeaderHash || header.headerHash !== expectedHeaderHash) return false;
|
|
1873
1881
|
return true;
|
|
1874
1882
|
} catch (error) {
|
|
1883
|
+
if (isBleStaleBondHardwareError(error)) {
|
|
1884
|
+
throw error;
|
|
1885
|
+
}
|
|
1875
1886
|
Log.log(`[FirmwareUpdateV4] RESC bundle ${bundle.name} header check failed: `, error);
|
|
1876
1887
|
return false;
|
|
1877
1888
|
}
|
|
@@ -1965,7 +1976,7 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
1965
1976
|
}
|
|
1966
1977
|
lastError = new Error('Protocol V2 device is reachable but is not in bootloader mode');
|
|
1967
1978
|
} catch (error) {
|
|
1968
|
-
if (this.isProtocolV2ReconnectIdentityError(error)) {
|
|
1979
|
+
if (isBleStaleBondHardwareError(error) || this.isProtocolV2ReconnectIdentityError(error)) {
|
|
1969
1980
|
throw error;
|
|
1970
1981
|
}
|
|
1971
1982
|
shouldReconnect = true;
|
|
@@ -2263,6 +2274,9 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
2263
2274
|
return processedSize + source.size;
|
|
2264
2275
|
} catch (error) {
|
|
2265
2276
|
this.throwIfAborted();
|
|
2277
|
+
if (isBleStaleBondHardwareError(error)) {
|
|
2278
|
+
throw error;
|
|
2279
|
+
}
|
|
2266
2280
|
lastError = error;
|
|
2267
2281
|
if (attempt < PROTOCOL_V2_FILE_TRANSFER_RETRY_COUNT) {
|
|
2268
2282
|
await this.recoverProtocolV2FileTransfer();
|
|
@@ -2930,6 +2944,9 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
2930
2944
|
return;
|
|
2931
2945
|
}
|
|
2932
2946
|
} catch (error) {
|
|
2947
|
+
if (isBleStaleBondHardwareError(error)) {
|
|
2948
|
+
throw error;
|
|
2949
|
+
}
|
|
2933
2950
|
Log.log('[FirmwareUpdateV4] unable to confirm App mode before Normal reboot: ', error);
|
|
2934
2951
|
}
|
|
2935
2952
|
await this.protocolV2Reboot(DeviceRebootType.Normal);
|
|
@@ -3022,7 +3039,7 @@ export default class FirmwareUpdateV4 extends FirmwareUpdateBaseMethod<FirmwareU
|
|
|
3022
3039
|
'Protocol V2 device is still in bootloader mode'
|
|
3023
3040
|
);
|
|
3024
3041
|
} catch (error) {
|
|
3025
|
-
if (this.isProtocolV2ReconnectIdentityError(error)) {
|
|
3042
|
+
if (isBleStaleBondHardwareError(error) || this.isProtocolV2ReconnectIdentityError(error)) {
|
|
3026
3043
|
throw error;
|
|
3027
3044
|
}
|
|
3028
3045
|
shouldReconnect = true;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
|
|
1
|
+
import { ERRORS, HardwareErrorCode, createDeviceNotSupportMethodError } from '@onekeyfe/hd-shared';
|
|
2
2
|
|
|
3
3
|
import { UI_REQUEST } from '../constants/ui-request';
|
|
4
4
|
import { BaseMethod } from './BaseMethod';
|
|
@@ -49,7 +49,10 @@ export default class GetDeviceState extends BaseMethod<
|
|
|
49
49
|
this.device.isProtocolV2() &&
|
|
50
50
|
isLoaderMode(state.status.mode)
|
|
51
51
|
) {
|
|
52
|
-
throw
|
|
52
|
+
throw createDeviceNotSupportMethodError(
|
|
53
|
+
`${this.name}:${this.params.scope}`,
|
|
54
|
+
this.device.getCurrentFirmwareType()
|
|
55
|
+
);
|
|
53
56
|
}
|
|
54
57
|
return state;
|
|
55
58
|
}
|
package/src/core/index.ts
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
createNeedUpgradeFirmwareHardwareError,
|
|
24
24
|
createNewFirmwareForceUpdateHardwareError,
|
|
25
25
|
createNewFirmwareUnReleaseHardwareError,
|
|
26
|
+
isBleStaleBondHardwareError,
|
|
26
27
|
} from '@onekeyfe/hd-shared';
|
|
27
28
|
|
|
28
29
|
import { LoggerNames, enableLog, getLogger, setLoggerPostMessage, wait } from '../utils';
|
|
@@ -1034,6 +1035,10 @@ export function isMissingDetectedProtocolV2Error(method: BaseMethod, error: unkn
|
|
|
1034
1035
|
);
|
|
1035
1036
|
}
|
|
1036
1037
|
|
|
1038
|
+
export function isTerminalBleStaleBondError(error: unknown) {
|
|
1039
|
+
return isBleStaleBondHardwareError(error);
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1037
1042
|
export function isDeviceIdentityMismatchError(error: unknown) {
|
|
1038
1043
|
return (
|
|
1039
1044
|
(error as { errorCode?: unknown })?.errorCode === HardwareErrorCode.DeviceCheckDeviceIdError
|
|
@@ -1272,7 +1277,6 @@ const ensureConnected = async (
|
|
|
1272
1277
|
HardwareErrorCode.BridgeNotInstalled,
|
|
1273
1278
|
HardwareErrorCode.BridgeTimeoutError,
|
|
1274
1279
|
HardwareErrorCode.BridgeNeedsPermission,
|
|
1275
|
-
HardwareErrorCode.WebUsbDeviceAccessError,
|
|
1276
1280
|
].includes(error.errorCode)
|
|
1277
1281
|
) {
|
|
1278
1282
|
_deviceList = undefined;
|
|
@@ -1359,7 +1363,6 @@ const ensureConnected = async (
|
|
|
1359
1363
|
HardwareErrorCode.DeviceDetectInBootloaderMode,
|
|
1360
1364
|
HardwareErrorCode.BleCharacteristicNotifyChangeFailure,
|
|
1361
1365
|
HardwareErrorCode.BridgeNeedsPermission,
|
|
1362
|
-
HardwareErrorCode.WebUsbDeviceAccessError,
|
|
1363
1366
|
HardwareErrorCode.DeviceInterruptedFromUser,
|
|
1364
1367
|
HardwareErrorCode.CallQueueActionCancelled,
|
|
1365
1368
|
].includes(error.errorCode) ||
|
|
@@ -1367,6 +1370,7 @@ const ensureConnected = async (
|
|
|
1367
1370
|
[HardwareErrorCode.BleDeviceDisconnected, HardwareErrorCode.PollingTimeout].includes(
|
|
1368
1371
|
error.errorCode
|
|
1369
1372
|
)) ||
|
|
1373
|
+
isTerminalBleStaleBondError(error) ||
|
|
1370
1374
|
isDeviceIdentityMismatchError(error)
|
|
1371
1375
|
) {
|
|
1372
1376
|
reject(error);
|
|
@@ -1589,7 +1593,7 @@ const onDeviceConnectHandler = (device: Device) => {
|
|
|
1589
1593
|
|
|
1590
1594
|
const onDeviceDisconnectHandler = (device: Device) => {
|
|
1591
1595
|
device.clearPreInitialized();
|
|
1592
|
-
const deviceObject = device.
|
|
1596
|
+
const deviceObject = device.toMessageObject();
|
|
1593
1597
|
if (!deviceObject) return;
|
|
1594
1598
|
postMessage(createDeviceMessage(DEVICE.DISCONNECT, { device: deviceObject }));
|
|
1595
1599
|
};
|
package/src/device/Device.ts
CHANGED
|
@@ -248,9 +248,6 @@ export class Device extends EventEmitter {
|
|
|
248
248
|
/** Canonical device-state cache; legacy Features is a compatibility projection. */
|
|
249
249
|
private stateStore = new DeviceStateStore();
|
|
250
250
|
|
|
251
|
-
/** Retain the old public identity only for disconnect notifications after wipe. */
|
|
252
|
-
private deviceBeforeWipe: DeviceTyped | null = null;
|
|
253
|
-
|
|
254
251
|
/** Force the next initialization to reload DeviceInfo after reconnect or reboot. */
|
|
255
252
|
private protocolV2StateNeedsReload = false;
|
|
256
253
|
|
|
@@ -354,8 +351,6 @@ export class Device extends EventEmitter {
|
|
|
354
351
|
toMessageObject(): DeviceTyped | null {
|
|
355
352
|
if (this.isUnacquired() || !this.features) return null;
|
|
356
353
|
|
|
357
|
-
this.deviceBeforeWipe = null;
|
|
358
|
-
|
|
359
354
|
const env = DataManager.getSettings('env');
|
|
360
355
|
const deviceType = this.getCurrentDeviceType();
|
|
361
356
|
|
|
@@ -400,10 +395,6 @@ export class Device extends EventEmitter {
|
|
|
400
395
|
};
|
|
401
396
|
}
|
|
402
397
|
|
|
403
|
-
toDisconnectMessageObject(): DeviceTyped | null {
|
|
404
|
-
return this.toMessageObject() ?? this.deviceBeforeWipe;
|
|
405
|
-
}
|
|
406
|
-
|
|
407
398
|
/**
|
|
408
399
|
* Device connect
|
|
409
400
|
* @returns {Promise<boolean>}
|
|
@@ -1373,7 +1364,6 @@ export class Device extends EventEmitter {
|
|
|
1373
1364
|
}
|
|
1374
1365
|
|
|
1375
1366
|
invalidateAfterWipe() {
|
|
1376
|
-
this.deviceBeforeWipe = this.toMessageObject() ?? this.deviceBeforeWipe;
|
|
1377
1367
|
const deviceId = this.getCurrentDeviceId();
|
|
1378
1368
|
if (deviceId) {
|
|
1379
1369
|
deviceWalletSessionStore.deleteDevice(deviceId);
|
|
@@ -1811,7 +1801,7 @@ export class Device extends EventEmitter {
|
|
|
1811
1801
|
// both allow and require cases might generate single unexpected mode
|
|
1812
1802
|
if (!this.isUnacquired()) {
|
|
1813
1803
|
// allow cases
|
|
1814
|
-
if (
|
|
1804
|
+
if (this.isBootloader() && !this.isProtocolV2() && !allow.includes(UI_REQUEST.BOOTLOADER)) {
|
|
1815
1805
|
return UI_REQUEST.BOOTLOADER;
|
|
1816
1806
|
}
|
|
1817
1807
|
if (!this.isInitialized() && !allow.includes(UI_REQUEST.NOT_INITIALIZE)) {
|
|
@@ -549,16 +549,6 @@ export class DeviceCommands {
|
|
|
549
549
|
this.device.isProtocolV2() &&
|
|
550
550
|
DEVICE_CONTROL_CALLS.has(callType) &&
|
|
551
551
|
subcode === DeviceErrorCode.DeviceError_Busy;
|
|
552
|
-
const isProtocolV2PinCancelledBusyFailure =
|
|
553
|
-
this.device.isProtocolV2() &&
|
|
554
|
-
!DEVICE_SESSION_CALLS.has(callType) &&
|
|
555
|
-
subcode === DeviceSessionErrorCode.DeviceSessionError_UserCancelled &&
|
|
556
|
-
/^pin cancelled$/i.test(normalizedMessage);
|
|
557
|
-
const isProtocolV2FirmwareUpdateBusyFailure =
|
|
558
|
-
this.device.isProtocolV2() &&
|
|
559
|
-
/^requested command not allowed while a firmware update is in progress$/i.test(
|
|
560
|
-
normalizedMessage
|
|
561
|
-
);
|
|
562
552
|
const isLegacyProtocolV2LockedFailure =
|
|
563
553
|
this.device.isProtocolV2() && /^device (?:is )?locked$/i.test(normalizedMessage);
|
|
564
554
|
if (
|
|
@@ -616,11 +606,7 @@ export class DeviceCommands {
|
|
|
616
606
|
subcode,
|
|
617
607
|
firmwareMessage: message,
|
|
618
608
|
});
|
|
619
|
-
} else if (
|
|
620
|
-
isProtocolV2DeviceBusyFailure ||
|
|
621
|
-
isProtocolV2PinCancelledBusyFailure ||
|
|
622
|
-
isProtocolV2FirmwareUpdateBusyFailure
|
|
623
|
-
) {
|
|
609
|
+
} else if (isProtocolV2DeviceBusyFailure) {
|
|
624
610
|
error = ERRORS.TypedError(HardwareErrorCode.DeviceBusy, message, {
|
|
625
611
|
failureCode: code,
|
|
626
612
|
subcode,
|
package/src/device/DevicePool.ts
CHANGED
|
@@ -114,11 +114,7 @@ export class DevicePool extends EventEmitter {
|
|
|
114
114
|
const exist = canPathIdentifyDevice(cachedPath)
|
|
115
115
|
? descriptorList.find(d => d.path === cachedPath)
|
|
116
116
|
: undefined;
|
|
117
|
-
if (
|
|
118
|
-
exist &&
|
|
119
|
-
!initOptions?.forceProtocolDetection &&
|
|
120
|
-
!(device.needReloadDevice && device.isUnacquired())
|
|
121
|
-
) {
|
|
117
|
+
if (exist && !initOptions?.forceProtocolDetection) {
|
|
122
118
|
// Log.debug('find existed Device: ', connectId);
|
|
123
119
|
device.updateDescriptor(exist, true);
|
|
124
120
|
await this._refreshRuntimeState(device, initOptions);
|
|
@@ -174,13 +170,7 @@ export class DevicePool extends EventEmitter {
|
|
|
174
170
|
const forceProtocolDetection = initOptions?.forceProtocolDetection === true;
|
|
175
171
|
const isNewDevice = !cachedDevice;
|
|
176
172
|
const device = cachedDevice ?? Device.fromDescriptor(descriptor);
|
|
177
|
-
if (
|
|
178
|
-
isNewDevice ||
|
|
179
|
-
forceProtocolDetection ||
|
|
180
|
-
(device.needReloadDevice && device.isUnacquired())
|
|
181
|
-
) {
|
|
182
|
-
// Wipe invalidates state while the same USB path can remain discoverable.
|
|
183
|
-
if (cachedDevice) device.updateDescriptor(descriptor, true);
|
|
173
|
+
if (isNewDevice || forceProtocolDetection) {
|
|
184
174
|
device.deviceConnector = this.connector;
|
|
185
175
|
// Search/discovery acquires outside Device.run(). Start a new attempt so
|
|
186
176
|
// a previous user cancel does not hide this device from later searches.
|
package/src/events/core.ts
CHANGED
|
@@ -54,9 +54,9 @@ export const parseMessage = (messageData: any): CoreMessage => {
|
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
export const createErrorMessage = (error: Error & { code?: string | number }): Unsuccessful => {
|
|
57
|
-
let payload
|
|
57
|
+
let payload = { error: error.message, code: error.code };
|
|
58
58
|
if (error instanceof HardwareError) {
|
|
59
|
-
payload = { error: error.message, code: error.errorCode
|
|
59
|
+
payload = { error: error.message, code: error.errorCode };
|
|
60
60
|
}
|
|
61
61
|
return {
|
|
62
62
|
success: false,
|
package/src/types/params.ts
CHANGED
|
@@ -83,7 +83,7 @@ export type Params<T> = CommonParams & T & { bundle?: undefined };
|
|
|
83
83
|
|
|
84
84
|
export interface Unsuccessful {
|
|
85
85
|
success: false;
|
|
86
|
-
payload: { error: string; code?: string | number
|
|
86
|
+
payload: { error: string; code?: string | number };
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
export interface Success<T> {
|