@onekeyfe/hd-transport-web-device 1.0.38-alpha.2 → 1.0.38-alpha.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"electron-ble-transport.d.ts","sourceRoot":"","sources":["../src/electron-ble-transport.ts"],"names":[],"mappings":";AAAA,OAAO,SAAkD,MAAM,wBAAwB,CAAC;AACxF,OAAO,EAGL,QAAQ,EAGT,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,YAAY,MAAM,QAAQ,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAKlE,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,UAAU,CAAC,EAAE,UAAU,CAAC;KACzB;CACF;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AASF,MAAM,CAAC,OAAO,OAAO,oBAAoB;IACvC,SAAS,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;IAEnE,IAAI,SAA0B;IAE9B,UAAU,UAAS;IAEnB,UAAU,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;IAExC,GAAG,CAAC,EAAE,GAAG,CAAC;IAEV,OAAO,CAAC,EAAE,YAAY,CAAC;IAGvB,OAAO,CAAC,gBAAgB,CAA0B;IAGlD,OAAO,CAAC,WAAW,CAAsE;IAGzF,OAAO,CAAC,oBAAoB,CAAsC;IAGlE,OAAO,CAAC,kBAAkB,CAAsC;IAGhE,OAAO,CAAC,kBAAkB;IAmB1B,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,YAAY;IAexC,SAAS,CAAC,UAAU,EAAE,GAAG;IAMzB,MAAM;IAEA,SAAS,IAAI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AU,EAAE,GAAG;IAMzB,MAAM;IAEA,SAAS,IAAI,OAAO,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAcpD,OAAO,CAAC,KAAK,EAAE,eAAe;;;;IA0E9B,OAAO,CAAC,EAAE,EAAE,MAAM;IAwBxB,OAAO,CAAC,sBAAsB;IA2BxB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IA2EpE,OAAO,CAAC,yBAAyB;CAyDlC"}
|
package/dist/index.js
CHANGED
|
@@ -388,10 +388,17 @@ class ElectronBleTransport {
|
|
|
388
388
|
});
|
|
389
389
|
}
|
|
390
390
|
handleNotificationData(deviceId, hexData) {
|
|
391
|
-
var _a;
|
|
391
|
+
var _a, _b;
|
|
392
|
+
if (hexData === 'PAIRING_REJECTED') {
|
|
393
|
+
(_a = this.Log) === null || _a === void 0 ? void 0 : _a.debug('[Transport] Pairing rejection detected for device:', deviceId);
|
|
394
|
+
if (this.runPromise) {
|
|
395
|
+
this.runPromise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.BleDeviceBondedCanceled));
|
|
396
|
+
}
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
392
399
|
const result = this.processNotificationPacket(deviceId, hexData);
|
|
393
400
|
if (result.error) {
|
|
394
|
-
(
|
|
401
|
+
(_b = this.Log) === null || _b === void 0 ? void 0 : _b.error('[Transport] Packet processing error:', result.error);
|
|
395
402
|
if (this.runPromise) {
|
|
396
403
|
this.runPromise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.BleWriteCharacteristicError));
|
|
397
404
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-transport-web-device",
|
|
3
|
-
"version": "1.0.38-alpha.
|
|
3
|
+
"version": "1.0.38-alpha.3",
|
|
4
4
|
"author": "OneKey",
|
|
5
5
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"lint:fix": "eslint . --fix"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@onekeyfe/hd-shared": "^1.0.38-alpha.
|
|
24
|
-
"@onekeyfe/hd-transport": "^1.0.38-alpha.
|
|
23
|
+
"@onekeyfe/hd-shared": "^1.0.38-alpha.3",
|
|
24
|
+
"@onekeyfe/hd-transport": "^1.0.38-alpha.3"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/w3c-web-usb": "^1.0.6",
|
|
28
28
|
"@types/web-bluetooth": "^0.0.17"
|
|
29
29
|
},
|
|
30
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "dea1b80ce81d6c3f3b35cf4d78f6a7f762cb748b"
|
|
31
31
|
}
|
|
@@ -213,6 +213,15 @@ export default class ElectronBleTransport {
|
|
|
213
213
|
|
|
214
214
|
// Handle notification data from Noble BLE
|
|
215
215
|
private handleNotificationData(deviceId: string, hexData: string): void {
|
|
216
|
+
// Check for pairing rejection
|
|
217
|
+
if (hexData === 'PAIRING_REJECTED') {
|
|
218
|
+
this.Log?.debug('[Transport] Pairing rejection detected for device:', deviceId);
|
|
219
|
+
if (this.runPromise) {
|
|
220
|
+
this.runPromise.reject(ERRORS.TypedError(HardwareErrorCode.BleDeviceBondedCanceled));
|
|
221
|
+
}
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
|
|
216
225
|
const result = this.processNotificationPacket(deviceId, hexData);
|
|
217
226
|
|
|
218
227
|
if (result.error) {
|