@onekeyfe/hd-transport-react-native 1.2.0-alpha.26 → 1.2.0-alpha.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/jest.config.js +5 -0
- package/package.json +6 -5
- package/src/__tests__/protocolV2Link.test.ts +4 -0
- package/src/index.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -298,7 +298,7 @@ const getFirmwareUploadWriteRetryType = (error) => {
|
|
|
298
298
|
const resolveFirmwareUploadRetryDelay = (attempt, baseDelayMs = 200, maxDelayMs = 1200) => Math.min(baseDelayMs * Math.pow(2, attempt), maxDelayMs);
|
|
299
299
|
const PROTOCOL_PROBE_TIMEOUT_MS = 1000;
|
|
300
300
|
const PROTOCOL_V2_PROBE_TIMEOUT_MS = 10000;
|
|
301
|
-
const DEVICE_SCAN_TIMEOUT_MS =
|
|
301
|
+
const DEVICE_SCAN_TIMEOUT_MS = 3000;
|
|
302
302
|
const IOS_NOTIFY_READY_DELAY_MS = 150;
|
|
303
303
|
const ANDROID_NOTIFY_READY_DELAY_MS = 300;
|
|
304
304
|
const DEFAULT_PROTOCOL_V2_BLE_TUNING = {
|
package/jest.config.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-transport-react-native",
|
|
3
|
-
"version": "1.2.0-alpha.
|
|
3
|
+
"version": "1.2.0-alpha.28",
|
|
4
4
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,15 +15,16 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"dev": "rimraf dist && rollup -c ../../build/rollup.config.js -w",
|
|
17
17
|
"build": "rimraf dist && rollup -c ../../build/rollup.config.js",
|
|
18
|
+
"test": "jest",
|
|
18
19
|
"lint": "eslint .",
|
|
19
20
|
"lint:fix": "eslint . --fix"
|
|
20
21
|
},
|
|
21
22
|
"dependencies": {
|
|
22
|
-
"@onekeyfe/hd-core": "1.2.0-alpha.
|
|
23
|
-
"@onekeyfe/hd-shared": "1.2.0-alpha.
|
|
24
|
-
"@onekeyfe/hd-transport": "1.2.0-alpha.
|
|
23
|
+
"@onekeyfe/hd-core": "1.2.0-alpha.28",
|
|
24
|
+
"@onekeyfe/hd-shared": "1.2.0-alpha.28",
|
|
25
|
+
"@onekeyfe/hd-transport": "1.2.0-alpha.28",
|
|
25
26
|
"@onekeyfe/react-native-ble-utils": "^0.1.6",
|
|
26
27
|
"react-native-ble-plx": "3.5.1"
|
|
27
28
|
},
|
|
28
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "b7c7f9f53c4d745f127d03e0b173e8b759bf8e15"
|
|
29
30
|
}
|
|
@@ -182,6 +182,10 @@ const createHarness = () => {
|
|
|
182
182
|
};
|
|
183
183
|
|
|
184
184
|
describe('ReactNativeBleTransport Protocol V2 link lifecycle', () => {
|
|
185
|
+
test('keeps the legacy default BLE scan timeout', () => {
|
|
186
|
+
expect(new ReactNativeBleTransport({}).scanTimeout).toBe(3000);
|
|
187
|
+
});
|
|
188
|
+
|
|
185
189
|
afterEach(() => {
|
|
186
190
|
resetProtocolV2BleTuning();
|
|
187
191
|
});
|
package/src/index.ts
CHANGED
|
@@ -107,7 +107,7 @@ const resolveFirmwareUploadRetryDelay = (attempt: number, baseDelayMs = 200, max
|
|
|
107
107
|
Math.min(baseDelayMs * 2 ** attempt, maxDelayMs);
|
|
108
108
|
const PROTOCOL_PROBE_TIMEOUT_MS = 1000;
|
|
109
109
|
const PROTOCOL_V2_PROBE_TIMEOUT_MS = 10_000;
|
|
110
|
-
const DEVICE_SCAN_TIMEOUT_MS =
|
|
110
|
+
const DEVICE_SCAN_TIMEOUT_MS = 3000;
|
|
111
111
|
const IOS_NOTIFY_READY_DELAY_MS = 150;
|
|
112
112
|
const ANDROID_NOTIFY_READY_DELAY_MS = 300;
|
|
113
113
|
export type ProtocolV2BleTuning = {
|