@onekeyfe/hd-transport-react-native
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -384,5 +384,6 @@ 'use strict'; | ||
transportCache[uuid] = transport; | ||
device.onDisconnected(() => { | ||
const disconnectSubscription = device.onDisconnected(() => { | ||
console.log('device disconnect: ', device === null || device === void 0 ? void 0 : device.id); | ||
this.release(uuid); | ||
disconnectSubscription === null || disconnectSubscription === void 0 ? void 0 : disconnectSubscription.remove(); | ||
}); | ||
@@ -396,5 +397,9 @@ return { uuid }; | ||
const subscription = characteristic.monitor((error, c) => { | ||
var _a, _b; | ||
var _a, _b, _c; | ||
if (error) { | ||
console.log(`error monitor ${characteristic.uuid}, deviceId: ${characteristic.deviceID}: ${error}`); | ||
if (this.runPromise) { | ||
this.runPromise.reject(hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.BleCharacteristicNotifyError, (_a = error.reason) !== null && _a !== void 0 ? _a : error.message)); | ||
console.log('@onekey/hd-ble-sdk: monitor notify error, and has unreleased Promise'); | ||
} | ||
return; | ||
@@ -418,3 +423,3 @@ } | ||
buffer$1 = []; | ||
(_a = this.runPromise) === null || _a === void 0 ? void 0 : _a.resolve(value.toString('hex')); | ||
(_b = this.runPromise) === null || _b === void 0 ? void 0 : _b.resolve(value.toString('hex')); | ||
} | ||
@@ -424,3 +429,3 @@ } | ||
console.log('monitor data error: ', error); | ||
(_b = this.runPromise) === null || _b === void 0 ? void 0 : _b.reject(error); | ||
(_c = this.runPromise) === null || _c === void 0 ? void 0 : _c.reject(error); | ||
} | ||
@@ -427,0 +432,0 @@ }); |
{ | ||
"name": "@onekeyfe/hd-transport-react-native", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme", | ||
@@ -23,8 +23,8 @@ "license": "MIT", | ||
"dependencies": { | ||
"@onekeyfe/hd-shared": "^0.1.6", | ||
"@onekeyfe/hd-transport": "^0.1.6", | ||
"@onekeyfe/hd-shared": "^0.1.7", | ||
"@onekeyfe/hd-transport": "^0.1.7", | ||
"react-native-ble-manager": "^8.1.0", | ||
"react-native-ble-plx": "^2.0.3" | ||
}, | ||
"gitHead": "ebe2789fa24cbfb798c9be445678e71e67e33d71" | ||
"gitHead": "1d3889d02e41afd60cd0388b6e01d7f2ac7c5399" | ||
} |
@@ -303,5 +303,6 @@ import { Platform } from 'react-native'; | ||
device.onDisconnected(() => { | ||
const disconnectSubscription = device.onDisconnected(() => { | ||
console.log('device disconnect: ', device?.id); | ||
this.release(uuid); | ||
disconnectSubscription?.remove(); | ||
}); | ||
@@ -322,2 +323,11 @@ | ||
); | ||
if (this.runPromise) { | ||
this.runPromise.reject( | ||
ERRORS.TypedError( | ||
HardwareErrorCode.BleCharacteristicNotifyError, | ||
error.reason ?? error.message | ||
) | ||
); | ||
console.log('@onekey/hd-ble-sdk: monitor notify error, and has unreleased Promise'); | ||
} | ||
return; | ||
@@ -324,0 +334,0 @@ } |
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
50615
1178
Updated@onekeyfe/hd-shared@^0.1.7