@onekeyfe/hd-transport-electron 1.2.0-alpha.181 → 1.2.0-alpha.183
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-56d2eab3.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-a518d449.js');
|
|
4
4
|
var hdShared = require('@onekeyfe/hd-shared');
|
|
5
5
|
var pRetry = require('p-retry');
|
|
6
6
|
|
|
@@ -545,7 +545,6 @@ function attemptWindowsWriteUntilPaired(deviceId, doGetWriteCharacteristic, payl
|
|
|
545
545
|
});
|
|
546
546
|
}
|
|
547
547
|
function transmitHexDataToDevice(deviceId, hexData, options) {
|
|
548
|
-
var _a;
|
|
549
548
|
return index.__awaiter(this, void 0, void 0, function* () {
|
|
550
549
|
const characteristics = deviceCharacteristics.get(deviceId);
|
|
551
550
|
const peripheral = connectedDevices.get(deviceId);
|
|
@@ -557,14 +556,6 @@ function transmitHexDataToDevice(deviceId, hexData, options) {
|
|
|
557
556
|
const doGetWriteCharacteristic = () => { var _a; return (_a = deviceCharacteristics.get(deviceId)) === null || _a === void 0 ? void 0 : _a.write; };
|
|
558
557
|
const packetCapacity = resolveBlePacketCapacity(peripheral.mtu, BLE_PACKET_SIZE_MAXIMUM, BLE_PACKET_SIZE_FALLBACK);
|
|
559
558
|
const pacingDelayMs = resolveNobleBleWritePacingDelay(options);
|
|
560
|
-
logger === null || logger === void 0 ? void 0 : logger.info('[NobleBLE] Write frame', {
|
|
561
|
-
deviceId,
|
|
562
|
-
bytes: toBuffer.length,
|
|
563
|
-
head: toBuffer.subarray(0, 8).toString('hex'),
|
|
564
|
-
packetCapacity,
|
|
565
|
-
mtu: (_a = peripheral.mtu) !== null && _a !== void 0 ? _a : null,
|
|
566
|
-
pacingDelayMs,
|
|
567
|
-
});
|
|
568
559
|
if (!IS_WINDOWS || pairedDevices.has(deviceId)) {
|
|
569
560
|
const writeCharacteristic = doGetWriteCharacteristic();
|
|
570
561
|
if (!writeCharacteristic) {
|
|
@@ -1318,11 +1309,6 @@ function subscribeNotifications(deviceId, callback) {
|
|
|
1318
1309
|
timeoutBehavior: 'reject',
|
|
1319
1310
|
});
|
|
1320
1311
|
notifyCharacteristic.on('data', (data) => {
|
|
1321
|
-
logger === null || logger === void 0 ? void 0 : logger.debug('[NobleBLE] Notify frame', {
|
|
1322
|
-
deviceId,
|
|
1323
|
-
bytes: data.length,
|
|
1324
|
-
head: data.subarray(0, 8).toString('hex'),
|
|
1325
|
-
});
|
|
1326
1312
|
if (!pairedDevices.has(deviceId)) {
|
|
1327
1313
|
pairedDevices.add(deviceId);
|
|
1328
1314
|
logger === null || logger === void 0 ? void 0 : logger.info('[NobleBLE] Device paired successfully', { deviceId });
|
|
@@ -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;AAsvDD,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.183",
|
|
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.183",
|
|
29
|
+
"@onekeyfe/hd-shared": "1.2.0-alpha.183",
|
|
30
|
+
"@onekeyfe/hd-transport": "1.2.0-alpha.183",
|
|
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": "fd9b6e749495b0144e734dbe32c57cf483547349"
|
|
40
40
|
}
|
package/src/noble-ble-handler.ts
CHANGED
|
@@ -733,17 +733,6 @@ async function transmitHexDataToDevice(
|
|
|
733
733
|
);
|
|
734
734
|
const pacingDelayMs = resolveNobleBleWritePacingDelay(options);
|
|
735
735
|
|
|
736
|
-
// Diagnostics: the frame header alone (report id + magic + message type +
|
|
737
|
-
// length) identifies which protocol frame went out, without logging payload.
|
|
738
|
-
logger?.info('[NobleBLE] Write frame', {
|
|
739
|
-
deviceId,
|
|
740
|
-
bytes: toBuffer.length,
|
|
741
|
-
head: toBuffer.subarray(0, 8).toString('hex'),
|
|
742
|
-
packetCapacity,
|
|
743
|
-
mtu: peripheral.mtu ?? null,
|
|
744
|
-
pacingDelayMs,
|
|
745
|
-
});
|
|
746
|
-
|
|
747
736
|
if (!IS_WINDOWS || pairedDevices.has(deviceId)) {
|
|
748
737
|
// macOS / Linux or already paired on Windows: direct write
|
|
749
738
|
const writeCharacteristic = doGetWriteCharacteristic();
|
|
@@ -1888,11 +1877,6 @@ async function subscribeNotifications(
|
|
|
1888
1877
|
});
|
|
1889
1878
|
|
|
1890
1879
|
notifyCharacteristic.on('data', (data: Buffer) => {
|
|
1891
|
-
logger?.debug('[NobleBLE] Notify frame', {
|
|
1892
|
-
deviceId,
|
|
1893
|
-
bytes: data.length,
|
|
1894
|
-
head: data.subarray(0, 8).toString('hex'),
|
|
1895
|
-
});
|
|
1896
1880
|
// Windows BLE pairing detection: receiving any data means device is paired
|
|
1897
1881
|
if (!pairedDevices.has(deviceId)) {
|
|
1898
1882
|
pairedDevices.add(deviceId);
|