@ledgerhq/react-native-hw-transport-ble 6.29.0-nightly.0 → 6.29.1-next.0
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.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +30 -4
- package/lib/BleTransport.d.ts.map +1 -1
- package/lib/BleTransport.js +12 -18
- package/lib/BleTransport.js.map +1 -1
- package/lib/BleTransport.test.js +5 -5
- package/lib/BleTransport.test.js.map +1 -1
- package/lib/awaitsBleOn.js +1 -1
- package/lib/awaitsBleOn.js.map +1 -1
- package/lib/monitorCharacteristic.d.ts.map +1 -1
- package/lib/monitorCharacteristic.js +1 -1
- package/lib/monitorCharacteristic.js.map +1 -1
- package/lib/remapErrors.d.ts.map +1 -1
- package/lib/remapErrors.js +2 -6
- package/lib/remapErrors.js.map +1 -1
- package/lib-es/BleTransport.d.ts.map +1 -1
- package/lib-es/BleTransport.js +14 -20
- package/lib-es/BleTransport.js.map +1 -1
- package/lib-es/BleTransport.test.js +5 -5
- package/lib-es/BleTransport.test.js.map +1 -1
- package/lib-es/awaitsBleOn.js +1 -1
- package/lib-es/awaitsBleOn.js.map +1 -1
- package/lib-es/monitorCharacteristic.d.ts.map +1 -1
- package/lib-es/monitorCharacteristic.js +1 -1
- package/lib-es/monitorCharacteristic.js.map +1 -1
- package/lib-es/remapErrors.d.ts.map +1 -1
- package/lib-es/remapErrors.js +2 -6
- package/lib-es/remapErrors.js.map +1 -1
- package/package.json +5 -5
- package/src/BleTransport.test.ts +11 -18
- package/src/BleTransport.ts +38 -97
- package/src/awaitsBleOn.ts +2 -2
- package/src/monitorCharacteristic.ts +4 -12
- package/src/remapErrors.ts +3 -11
package/src/remapErrors.ts
CHANGED
|
@@ -24,10 +24,7 @@ export const remapError = (error: IOBleErrorRemap): IOBleErrorRemap => {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
if (
|
|
28
|
-
error.message.includes("was disconnected") ||
|
|
29
|
-
error.message.includes("not found")
|
|
30
|
-
) {
|
|
27
|
+
if (error.message.includes("was disconnected") || error.message.includes("not found")) {
|
|
31
28
|
return new DisconnectedDevice();
|
|
32
29
|
}
|
|
33
30
|
|
|
@@ -43,10 +40,7 @@ export const decoratePromiseErrors = <A>(promise: Promise<A>): Promise<A> =>
|
|
|
43
40
|
|
|
44
41
|
export const bleErrorToHwTransportError = new Map([
|
|
45
42
|
[BleErrorCode.ScanStartFailed, HwTransportErrorType.BluetoothScanStartFailed],
|
|
46
|
-
[
|
|
47
|
-
BleErrorCode.LocationServicesDisabled,
|
|
48
|
-
HwTransportErrorType.LocationServicesDisabled,
|
|
49
|
-
],
|
|
43
|
+
[BleErrorCode.LocationServicesDisabled, HwTransportErrorType.LocationServicesDisabled],
|
|
50
44
|
[
|
|
51
45
|
// BluetoothUnauthorized actually represents a location service unauthorized error
|
|
52
46
|
BleErrorCode.BluetoothUnauthorized,
|
|
@@ -54,9 +48,7 @@ export const bleErrorToHwTransportError = new Map([
|
|
|
54
48
|
],
|
|
55
49
|
]);
|
|
56
50
|
|
|
57
|
-
export const mapBleErrorToHwTransportError = (
|
|
58
|
-
bleError: BleError
|
|
59
|
-
): HwTransportError => {
|
|
51
|
+
export const mapBleErrorToHwTransportError = (bleError: BleError): HwTransportError => {
|
|
60
52
|
const message = `${bleError.message}. Origin: ${bleError.errorCode}`;
|
|
61
53
|
|
|
62
54
|
const inferedType = bleErrorToHwTransportError.get(bleError.errorCode);
|