@scrumble-nl/react-native-honeywell-scanner 1.4.15 → 1.4.17
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
|
@@ -63,7 +63,7 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
|
|
|
63
63
|
params.putString("aimId", barcodeReadEvent.getAimId());
|
|
64
64
|
params.putString("charset", barcodeReadEvent.getCharset().toString());
|
|
65
65
|
|
|
66
|
-
if (D) Log.d("barcodeReadEvent", barcodeReadEvent.getBarcodeData().getBytes(barcodeReadEvent.getCharset()));
|
|
66
|
+
if (D) Log.d("barcodeReadEvent", bytesToHex(barcodeReadEvent.getBarcodeData().getBytes(barcodeReadEvent.getCharset())));
|
|
67
67
|
|
|
68
68
|
sendEvent(BARCODE_READ_SUCCESS, params);
|
|
69
69
|
}
|
|
@@ -76,6 +76,17 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
|
|
|
76
76
|
sendEvent(BARCODE_READ_FAIL, params);
|
|
77
77
|
}
|
|
78
78
|
|
|
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
|
+
|
|
79
90
|
public void registerReader(Promise promise) {
|
|
80
91
|
if (reader != null) {
|
|
81
92
|
reader.addBarcodeListener(HoneywellScannerModule.this);
|
|
@@ -88,7 +99,6 @@ public class HoneywellScannerModule extends ReactContextBaseJavaModule implement
|
|
|
88
99
|
reader.setProperty(BarcodeReader.PROPERTY_EAN_13_TWO_CHAR_ADDENDA_ENABLED, true);
|
|
89
100
|
reader.setProperty(BarcodeReader.PROPERTY_EAN_13_FIVE_CHAR_ADDENDA_ENABLED, true);
|
|
90
101
|
reader.setProperty(BarcodeReader.PROPERTY_DATAMATRIX_ENABLED, true);
|
|
91
|
-
reader.setProperty(BarcodeReader.PROPERTY_GS1_128_ENABLED, true);
|
|
92
102
|
reader.setProperty(BarcodeReader.DATA_PROCESSOR_SYMBOLOGY_ID_AIM, true);
|
|
93
103
|
promise.resolve(true);
|
|
94
104
|
} catch (ScannerUnavailableException | UnsupportedPropertyException e) {
|
package/package.json
CHANGED