@onekeyfe/hd-transport-electron 1.2.0-alpha.177 → 1.2.0-alpha.178
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.
|
@@ -32,7 +32,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
32
32
|
|
|
33
33
|
function initNobleBleSupport(webContents) {
|
|
34
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
const { setupNobleBleHandlers } = yield Promise.resolve().then(function () { return require('./noble-ble-handler-
|
|
35
|
+
const { setupNobleBleHandlers } = yield Promise.resolve().then(function () { return require('./noble-ble-handler-796173e1.js'); });
|
|
36
36
|
setupNobleBleHandlers(webContents);
|
|
37
37
|
});
|
|
38
38
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index = require('./index-
|
|
3
|
+
var index = require('./index-60f89cbb.js');
|
|
4
4
|
var hdShared = require('@onekeyfe/hd-shared');
|
|
5
5
|
var pRetry = require('p-retry');
|
|
6
6
|
|
|
@@ -1014,6 +1014,11 @@ function setupConnectionAndDiscoverServices(peripheral, deviceId, webContents) {
|
|
|
1014
1014
|
return yield discoverServicesAndCharacteristicsWithRetry(peripheral, deviceId);
|
|
1015
1015
|
}
|
|
1016
1016
|
catch (discoveryError) {
|
|
1017
|
+
if (peripheral.state === 'connected') {
|
|
1018
|
+
logger === null || logger === void 0 ? void 0 : logger.error('[NobleBLE] Service discovery failed on a live link, dropping it for a cold retry', discoveryError);
|
|
1019
|
+
yield disconnectDevice(deviceId).catch(() => undefined);
|
|
1020
|
+
throw discoveryError;
|
|
1021
|
+
}
|
|
1017
1022
|
logger === null || logger === void 0 ? void 0 : logger.error('[NobleBLE] Service discovery failed, attempting fresh scan...', discoveryError);
|
|
1018
1023
|
return freshScanAndDiscover(deviceId, webContents);
|
|
1019
1024
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noble-ble-handler.d.ts","sourceRoot":"","sources":["../src/noble-ble-handler.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAA+B,WAAW,EAAE,MAAM,UAAU,CAAC;AAEzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAoFhE,wBAAgB,+BAA+B,CAAC,OAAO,CAAC,EAAE,oBAAoB,UAI7E;
|
|
1
|
+
{"version":3,"file":"noble-ble-handler.d.ts","sourceRoot":"","sources":["../src/noble-ble-handler.ts"],"names":[],"mappings":"AAgCA,OAAO,KAAK,EAA+B,WAAW,EAAE,MAAM,UAAU,CAAC;AAEzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAoFhE,wBAAgB,+BAA+B,CAAC,OAAO,CAAC,EAAE,oBAAoB,UAI7E;AA8vDD,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAkMpE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-transport-electron",
|
|
3
|
-
"version": "1.2.0-alpha.
|
|
3
|
+
"version": "1.2.0-alpha.178",
|
|
4
4
|
"author": "OneKey",
|
|
5
5
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"electron-log": ">=4.0.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@onekeyfe/hd-core": "1.2.0-alpha.
|
|
29
|
-
"@onekeyfe/hd-shared": "1.2.0-alpha.
|
|
30
|
-
"@onekeyfe/hd-transport": "1.2.0-alpha.
|
|
28
|
+
"@onekeyfe/hd-core": "1.2.0-alpha.178",
|
|
29
|
+
"@onekeyfe/hd-shared": "1.2.0-alpha.178",
|
|
30
|
+
"@onekeyfe/hd-transport": "1.2.0-alpha.178",
|
|
31
31
|
"@stoprocent/noble": "2.3.16",
|
|
32
32
|
"p-retry": "^4.6.2"
|
|
33
33
|
},
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
"electron": "^25.0.0",
|
|
37
37
|
"typescript": "^5.3.3"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "5df24cf8ab1b0e1909e5d9715b15ab042bba3ac7"
|
|
40
40
|
}
|
package/src/noble-ble-handler.ts
CHANGED
|
@@ -1431,6 +1431,20 @@ async function setupConnectionAndDiscoverServices(
|
|
|
1431
1431
|
try {
|
|
1432
1432
|
return await discoverServicesAndCharacteristicsWithRetry(peripheral, deviceId);
|
|
1433
1433
|
} catch (discoveryError) {
|
|
1434
|
+
// A connected peripheral does not advertise, so the fresh scan below can
|
|
1435
|
+
// only run out its timeout. Drop the link instead and let the caller come
|
|
1436
|
+
// back with a cold connect: that reconnect is what recovers a device whose
|
|
1437
|
+
// stack stopped serving its application layer, and it starts seconds
|
|
1438
|
+
// earlier this way. The scan still runs when the link is already down,
|
|
1439
|
+
// which is the case it was written for.
|
|
1440
|
+
if (peripheral.state === 'connected') {
|
|
1441
|
+
logger?.error(
|
|
1442
|
+
'[NobleBLE] Service discovery failed on a live link, dropping it for a cold retry',
|
|
1443
|
+
discoveryError
|
|
1444
|
+
);
|
|
1445
|
+
await disconnectDevice(deviceId).catch(() => undefined);
|
|
1446
|
+
throw discoveryError;
|
|
1447
|
+
}
|
|
1434
1448
|
logger?.error('[NobleBLE] Service discovery failed, attempting fresh scan...', discoveryError);
|
|
1435
1449
|
return freshScanAndDiscover(deviceId, webContents);
|
|
1436
1450
|
}
|