Launch Week Day 5: Introducing Reachability for PHP.Learn More
Socket
Book a DemoSign in
Socket

@onekeyfe/hd-transport-react-native

Package Overview
Dependencies
Maintainers
2
Versions
466
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@onekeyfe/hd-transport-react-native - npm Package Compare versions

Comparing version
0.1.22
to
0.1.23
+1
-0
dist/BleManager.d.ts

@@ -20,2 +20,3 @@ export declare const initializeBleManager: () => void;

}[]>;
export declare const refreshCache: (peripheralId: string) => Promise<void>;
//# sourceMappingURL=BleManager.d.ts.map
+1
-1

@@ -1,1 +0,1 @@

{"version":3,"file":"BleManager.d.ts","sourceRoot":"","sources":["../src/BleManager.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,YAEhC,CAAC;AAOF,eAAO,MAAM,qBAAqB,iBAAwB,MAAM,EAAE;;;;;;;;IAMjE,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;IAM5B,CAAC"}
{"version":3,"file":"BleManager.d.ts","sourceRoot":"","sources":["../src/BleManager.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,YAEhC,CAAC;AAOF,eAAO,MAAM,qBAAqB,iBAAwB,MAAM,EAAE;;;;;;;;IAMjE,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;IAM5B,CAAC;AAEF,eAAO,MAAM,YAAY,iBAAwB,MAAM,kBAStD,CAAC"}

@@ -1,1 +0,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,sBAAsB,CAAC;AAE9B,OAAO,SAAiC,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAkB,QAAQ,EAA6B,MAAM,qBAAqB,CAAC;AAa1F,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAmBjE,MAA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,UAAU,UAAS;IAEnB,OAAO,UAAS;IAEhB,WAAW,SAAQ;IAEnB,UAAU,EAAE,QAAQ,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;IAExC,GAAG,CAAC,EAAE,GAAG,CAAC;gBAEE,OAAO,EAAE,gBAAgB;IAIrC,IAAI,CAAC,MAAM,EAAE,GAAG;IAIhB,SAAS,CAAC,UAAU,EAAE,GAAG;IAMzB,MAAM;IAIN,aAAa,IAAI,OAAO,CAAC,aAAa,CAAC;IAYjC,SAAS;IAsET,OAAO,CAAC,KAAK,EAAE,eAAe;;;IAiKpC,sBAAsB,CAAC,cAAc,EAAE,cAAc;IA4D/C,OAAO,CAAC,IAAI,EAAE,MAAM;IAcpB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAkFpE,IAAI;IAIJ,MAAM;CAOP"}

@@ -170,3 +170,3 @@ 'use strict';

let connectOptions = {
requestMTU: 512,
requestMTU: 256,
timeout: 3000,

@@ -307,2 +307,3 @@ };

device = yield blePlxManager.connectToDevice(uuid);
this.Log.debug('first try to reconnect without params');
}

@@ -323,3 +324,3 @@ else {

catch (e) {
this.Log.debug('try to connect to device has error: ', e);
this.Log.debug('not connected, try to connect to device has error: ', e);
if (e.errorCode === reactNativeBlePlx.BleErrorCode.DeviceMTUChangeFailed ||

@@ -329,2 +330,3 @@ e.errorCode === reactNativeBlePlx.BleErrorCode.OperationCancelled) {

yield device.connect();
this.Log.debug('second try to reconnect without params');
}

@@ -507,7 +509,10 @@ else {

catch (e) {
this.Log.debug('writeCharacteristic write error: ', e);
this.runPromise = null;
if (e.errorCode === reactNativeBlePlx.BleErrorCode.DeviceDisconnected) {
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.BleDeviceNotBonded);
}
this.runPromise = null;
this.Log.debug('writeCharacteristic write error: ', e);
if (e.errorCode === reactNativeBlePlx.BleErrorCode.OperationStartFailed) {
throw hdShared.ERRORS.TypedError(hdShared.HardwareErrorCode.BleWriteCharacteristicError, e.reason);
}
return;

@@ -514,0 +519,0 @@ }

{
"name": "@onekeyfe/hd-transport-react-native",
"version": "0.1.22",
"version": "0.1.23",
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",

@@ -23,8 +23,8 @@ "license": "MIT",

"dependencies": {
"@onekeyfe/hd-shared": "^0.1.22",
"@onekeyfe/hd-transport": "^0.1.22",
"@onekeyfe/hd-shared": "^0.1.23",
"@onekeyfe/hd-transport": "^0.1.23",
"react-native-ble-manager": "^8.1.0",
"react-native-ble-plx": "^2.0.3"
},
"gitHead": "ebc730c7be2b0d11fc8ec5f3ee08b1440d345c7a"
"gitHead": "1d460705e90267f20fff95c9cd118c8ba818c7bc"
}

@@ -27,1 +27,12 @@ import BleManager from 'react-native-ble-manager';

};
export const refreshCache = async (peripheralId: string) => {
try {
await BleManager.connect(peripheralId);
await BleManager.refreshCache(peripheralId);
await BleManager.disconnect(peripheralId, true);
console.log('refreshCache success');
} catch (error) {
console.log('refreshCache error: ', error);
}
};

@@ -32,3 +32,3 @@ import { Platform } from 'react-native';

let connectOptions: Record<string, unknown> = {
requestMTU: 512,
requestMTU: 256,
timeout: 3000,

@@ -210,2 +210,3 @@ };

device = await blePlxManager.connectToDevice(uuid);
this.Log.debug('first try to reconnect without params');
} else {

@@ -227,3 +228,3 @@ throw ERRORS.TypedError(HardwareErrorCode.BleConnectedError, e.reason ?? e);

} catch (e) {
this.Log.debug('try to connect to device has error: ', e);
this.Log.debug('not connected, try to connect to device has error: ', e);
if (

@@ -235,2 +236,3 @@ e.errorCode === BleErrorCode.DeviceMTUChangeFailed ||

await device.connect();
this.Log.debug('second try to reconnect without params');
} else {

@@ -447,7 +449,10 @@ throw ERRORS.TypedError(HardwareErrorCode.BleConnectedError, e.reason ?? e);

} catch (e) {
this.Log.debug('writeCharacteristic write error: ', e);
this.runPromise = null;
if (e.errorCode === BleErrorCode.DeviceDisconnected) {
throw ERRORS.TypedError(HardwareErrorCode.BleDeviceNotBonded);
}
this.runPromise = null;
this.Log.debug('writeCharacteristic write error: ', e);
if (e.errorCode === BleErrorCode.OperationStartFailed) {
throw ERRORS.TypedError(HardwareErrorCode.BleWriteCharacteristicError, e.reason);
}
return;

@@ -454,0 +459,0 @@ }