@onekeyfe/hd-transport-react-native
Advanced tools
Comparing version 0.1.35 to 0.1.36
@@ -309,4 +309,4 @@ 'use strict'; | ||
connectOptions = {}; | ||
this.Log.debug('first try to reconnect without params'); | ||
device = yield blePlxManager.connectToDevice(uuid); | ||
this.Log.debug('first try to reconnect without params'); | ||
} | ||
@@ -331,4 +331,14 @@ else { | ||
connectOptions = {}; | ||
yield device.connect(); | ||
this.Log.debug('second try to reconnect without params'); | ||
try { | ||
yield device.connect(); | ||
} | ||
catch (e) { | ||
this.Log.debug('last try to reconnect error: ', e); | ||
if (e.errorCode === reactNativeBlePlx.BleErrorCode.OperationCancelled) { | ||
this.Log.debug('last try to reconnect'); | ||
yield device.cancelConnection(); | ||
yield device.connect(); | ||
} | ||
} | ||
} | ||
@@ -335,0 +345,0 @@ else { |
{ | ||
"name": "@onekeyfe/hd-transport-react-native", | ||
"version": "0.1.35", | ||
"version": "0.1.36", | ||
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme", | ||
@@ -23,8 +23,8 @@ "license": "MIT", | ||
"dependencies": { | ||
"@onekeyfe/hd-shared": "^0.1.35", | ||
"@onekeyfe/hd-transport": "^0.1.35", | ||
"@onekeyfe/hd-shared": "^0.1.36", | ||
"@onekeyfe/hd-transport": "^0.1.36", | ||
"react-native-ble-manager": "^8.1.0", | ||
"react-native-ble-plx": "^2.0.3" | ||
}, | ||
"gitHead": "8ad01282e959a37412b4f5de6bfe0ca248cf27e3" | ||
"gitHead": "46ed925a322c0717c74c6bb2e0bb5e7f5df21fcf" | ||
} |
@@ -215,4 +215,4 @@ import { Platform } from 'react-native'; | ||
connectOptions = {}; | ||
this.Log.debug('first try to reconnect without params'); | ||
device = await blePlxManager.connectToDevice(uuid); | ||
this.Log.debug('first try to reconnect without params'); | ||
} else { | ||
@@ -240,4 +240,15 @@ throw ERRORS.TypedError(HardwareErrorCode.BleConnectedError, e.reason ?? e); | ||
connectOptions = {}; | ||
await device.connect(); | ||
this.Log.debug('second try to reconnect without params'); | ||
try { | ||
await device.connect(); | ||
} catch (e) { | ||
this.Log.debug('last try to reconnect error: ', e); | ||
// last try to reconnect device if this issue exists | ||
// https://github.com/dotintent/react-native-ble-plx/issues/426 | ||
if (e.errorCode === BleErrorCode.OperationCancelled) { | ||
this.Log.debug('last try to reconnect'); | ||
await device.cancelConnection(); | ||
await device.connect(); | ||
} | ||
} | ||
} else { | ||
@@ -244,0 +255,0 @@ throw ERRORS.TypedError(HardwareErrorCode.BleConnectedError, e.reason ?? e); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55339
1267