@scrumble-nl/react-native-honeywell-scanner 1.4.15 → 1.4.16

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.
@@ -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);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@scrumble-nl/react-native-honeywell-scanner",
3
3
  "title": "React Native Honeywell Scanner",
4
- "version": "1.4.15",
4
+ "version": "1.4.16",
5
5
  "description": "Bridge to use the Honeywell scanner",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",