@onekeyfe/hd-transport-react-native 1.0.25-alpha.4 → 1.0.25-alpha.6

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":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EACL,UAAU,IAAI,aAAa,EAC3B,MAAM,EAEN,cAAc,EAEf,MAAM,gCAAgC,CAAC;AAExC,OAAO,SAAkD,MAAM,wBAAwB,CAAC;AACxF,OAAO,EAAkB,QAAQ,EAA6B,MAAM,qBAAqB,CAAC;AAC1F,OAAO,KAAK,YAAY,MAAM,QAAQ,CAAC;AAavC,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAoBjE,MAAM,CAAC,OAAO,OAAO,uBAAuB;IAC1C,aAAa,EAAE,aAAa,GAAG,SAAS,CAAC;IAEzC,SAAS,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;IAEnE,UAAU,UAAS;IAEnB,OAAO,UAAS;IAEhB,WAAW,SAAQ;IAEnB,UAAU,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;IAExC,GAAG,CAAC,EAAE,GAAG,CAAC;IAEV,OAAO,CAAC,EAAE,YAAY,CAAC;gBAEX,OAAO,EAAE,gBAAgB;IAIrC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,YAAY;IAKvC,SAAS,CAAC,UAAU,EAAE,GAAG;IAMzB,MAAM;IAIN,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC;IAYjC,SAAS;IA6FT,OAAO,CAAC,KAAK,EAAE,eAAe;;;IAmNpC,sBAAsB,CAAC,cAAc,EAAE,cAAc;IAgF/C,OAAO,CAAC,IAAI,EAAE,MAAM;IAepB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAA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OAAO,CAAC;IAwHpE,IAAI;IAIJ,MAAM;CAOP"}
package/dist/index.js CHANGED
@@ -505,7 +505,7 @@ class ReactNativeBleTransport {
505
505
  let bufferLength = 0;
506
506
  let buffer$1 = [];
507
507
  const subscription = characteristic.monitor((error, c) => {
508
- var _a, _b, _c, _d, _e, _f, _g;
508
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
509
509
  if (error) {
510
510
  this.Log.debug(`error monitor ${characteristic.uuid}, deviceId: ${characteristic.deviceID}: ${error}`);
511
511
  if (this.runPromise) {
@@ -518,7 +518,9 @@ class ReactNativeBleTransport {
518
518
  }
519
519
  if (((_c = error.reason) === null || _c === void 0 ? void 0 : _c.includes('Cannot write client characteristic config descriptor')) ||
520
520
  ((_d = error.reason) === null || _d === void 0 ? void 0 : _d.includes('Cannot find client characteristic config descriptor')) ||
521
- ((_e = error.reason) === null || _e === void 0 ? void 0 : _e.includes('The handle is invalid'))) {
521
+ ((_e = error.reason) === null || _e === void 0 ? void 0 : _e.includes('The handle is invalid')) ||
522
+ ((_f = error.reason) === null || _f === void 0 ? void 0 : _f.includes('Writing is not permitted')) ||
523
+ ((_g = error.reason) === null || _g === void 0 ? void 0 : _g.includes('notify change failed for device'))) {
522
524
  this.runPromise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.BleCharacteristicNotifyChangeFailure));
523
525
  this.Log.debug(`${hdShared.HardwareErrorCode.BleCharacteristicNotifyChangeFailure} ${error.message} ${error.reason}`);
524
526
  return;
@@ -544,12 +546,12 @@ class ReactNativeBleTransport {
544
546
  const value = buffer.Buffer.from(buffer$1);
545
547
  bufferLength = 0;
546
548
  buffer$1 = [];
547
- (_f = this.runPromise) === null || _f === void 0 ? void 0 : _f.resolve(value.toString('hex'));
549
+ (_h = this.runPromise) === null || _h === void 0 ? void 0 : _h.resolve(value.toString('hex'));
548
550
  }
549
551
  }
550
552
  catch (error) {
551
553
  this.Log.debug('monitor data error: ', error);
552
- (_g = this.runPromise) === null || _g === void 0 ? void 0 : _g.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.BleWriteCharacteristicError));
554
+ (_j = this.runPromise) === null || _j === void 0 ? void 0 : _j.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.BleWriteCharacteristicError));
553
555
  }
554
556
  });
555
557
  return () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/hd-transport-react-native",
3
- "version": "1.0.25-alpha.4",
3
+ "version": "1.0.25-alpha.6",
4
4
  "homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -19,10 +19,10 @@
19
19
  "lint:fix": "eslint . --fix"
20
20
  },
21
21
  "dependencies": {
22
- "@onekeyfe/hd-shared": "^1.0.25-alpha.4",
23
- "@onekeyfe/hd-transport": "^1.0.25-alpha.4",
22
+ "@onekeyfe/hd-shared": "^1.0.25-alpha.6",
23
+ "@onekeyfe/hd-transport": "^1.0.25-alpha.6",
24
24
  "@onekeyfe/react-native-ble-plx": "3.0.1",
25
25
  "react-native-ble-manager": "^8.1.0"
26
26
  },
27
- "gitHead": "5718b17035adead1c4565e4c2bacd821fb758ab1"
27
+ "gitHead": "fb1672611aea441308c21aa26860b983613b5f42"
28
28
  }
package/src/index.ts CHANGED
@@ -419,8 +419,10 @@ export default class ReactNativeBleTransport {
419
419
  }
420
420
  if (
421
421
  error.reason?.includes('Cannot write client characteristic config descriptor') ||
422
- error.reason?.includes('Cannot find client characteristic config descriptor') ||
423
- error.reason?.includes('The handle is invalid')
422
+ error.reason?.includes('Cannot find client characteristic config descriptor') || // pro firmware 2.3.0 upgrade
423
+ error.reason?.includes('The handle is invalid') ||
424
+ error.reason?.includes('Writing is not permitted') || // pro firmware 2.3.4 upgrade
425
+ error.reason?.includes('notify change failed for device')
424
426
  ) {
425
427
  this.runPromise.reject(
426
428
  ERRORS.TypedError(HardwareErrorCode.BleCharacteristicNotifyChangeFailure)