@scrumble-nl/react-native-honeywell-scanner 1.4.19 → 1.5.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/android/src/main/java/com/scrumble/honeywellscannerinterface/HoneywellScannerModule.java
CHANGED
|
@@ -61,9 +61,6 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
|
|
|
61
61
|
WritableMap params = Arguments.createMap();
|
|
62
62
|
params.putString("data", barcodeReadEvent.getBarcodeData());
|
|
63
63
|
params.putString("aimId", barcodeReadEvent.getAimId());
|
|
64
|
-
params.putString("charset", barcodeReadEvent.getCharset().toString());
|
|
65
|
-
|
|
66
|
-
if (D) Log.d("barcodeReadEvent", bytesToHex(barcodeReadEvent.getBarcodeData().getBytes(barcodeReadEvent.getCharset())));
|
|
67
64
|
|
|
68
65
|
sendEvent(BARCODE_READ_SUCCESS, params);
|
|
69
66
|
}
|
|
@@ -76,23 +73,11 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
|
|
|
76
73
|
sendEvent(BARCODE_READ_FAIL, params);
|
|
77
74
|
}
|
|
78
75
|
|
|
79
|
-
private final char[] HEX_ARRAY = "0123456789ABCDEF".toCharArray();
|
|
80
|
-
public String bytesToHex(byte[] bytes) {
|
|
81
|
-
char[] hexChars = new char[bytes.length * 2];
|
|
82
|
-
for (int j = 0; j < bytes.length; j++) {
|
|
83
|
-
int v = bytes[j] & 0xFF;
|
|
84
|
-
hexChars[j * 2] = HEX_ARRAY[v >>> 4];
|
|
85
|
-
hexChars[j * 2 + 1] = HEX_ARRAY[v & 0x0F];
|
|
86
|
-
}
|
|
87
|
-
return new String(hexChars);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
76
|
public void registerReader(Promise promise) {
|
|
91
77
|
if (reader != null) {
|
|
92
78
|
reader.addBarcodeListener(HoneywellScannerModule.this);
|
|
93
79
|
try {
|
|
94
80
|
reader.claim();
|
|
95
|
-
reader.decode(false);
|
|
96
81
|
reader.setProperty(BarcodeReader.PROPERTY_EAN_8_ENABLED, true);
|
|
97
82
|
reader.setProperty(BarcodeReader.PROPERTY_EAN_8_CHECK_DIGIT_TRANSMIT_ENABLED, true);
|
|
98
83
|
reader.setProperty(BarcodeReader.PROPERTY_EAN_13_ENABLED, true);
|
|
@@ -100,9 +85,10 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
|
|
|
100
85
|
reader.setProperty(BarcodeReader.PROPERTY_EAN_13_TWO_CHAR_ADDENDA_ENABLED, true);
|
|
101
86
|
reader.setProperty(BarcodeReader.PROPERTY_EAN_13_FIVE_CHAR_ADDENDA_ENABLED, true);
|
|
102
87
|
reader.setProperty(BarcodeReader.PROPERTY_DATAMATRIX_ENABLED, true);
|
|
88
|
+
reader.setProperty(BarcodeReader.PROPERTY_GS1_128_ENABLED, true);
|
|
103
89
|
reader.setProperty(BarcodeReader.DATA_PROCESSOR_SYMBOLOGY_ID_AIM, true);
|
|
104
90
|
promise.resolve(true);
|
|
105
|
-
} catch (ScannerUnavailableException | UnsupportedPropertyException
|
|
91
|
+
} catch (ScannerUnavailableException | UnsupportedPropertyException e) {
|
|
106
92
|
promise.resolve(false);
|
|
107
93
|
e.printStackTrace();
|
|
108
94
|
}
|
package/package.json
CHANGED