Interoperability
Overview
Currently, the interoperability feature only maps a subset of functionality of the Zebra JavaScript SDK to their Datalogic equivalent methods. For the following mapping to succeed, the customer's web application is required to be built for the Zebra SDK, which must include the shim for the Zebra SDK. This shim, a small library of JavaScript code that acts as an intermediary, intercepting API calls injected by the Browser's WebView, for the purpose of both obfuscating and enhancing the SDK functionality, should be found in a file accessible to the web application, usually called rhoapi-modules-EB.js or rhoapi-modules.js.
Barcode
| Method | Mapped Action |
|---|---|
| enumerate | On a Zebra device, it would return a list of available scan engines. On a Datalogic device it is simply hard coded to return a value because it doesn't have a functional use. |
| setDefault | On a Zebra device, set the scanner to listen to. On a Datalogic device it has no meaning, it performs a no op. |
| disable | Disables all registered scan listeners of the Browser. Maps to BarcodeManager.release(). |
| enable | Registers the callback function to be triggered on scan received scan data. Object argument ignored. Uses BarcodeManger.addReadListener. |
| Property | Type | Description |
|---|---|---|
| allDecoders | Boolean | Enable/disable all symbologies. Maps to BarcodeManager.enableAllSymbologies. |
| pdf417 | Boolean | Enable/disable PDF417 symbology. Maps to PDF417_ENABLE. |
| upca | Boolean | Enable/disable UPCA symbology. Maps to UPCA_ENABLE. |
| upce0 | Boolean | Enable/disable UPCE symbology. Maps to UPCE_ENABLE. |
| msi | Boolean | Enable/disable MSI symbology. Maps to MSI_ENABLE. |
| msiReportCheckDigit | Boolean | Enable/disable MSI Send Checksum. Maps to MSI_SEND_CHECK. |
| i2of5 | Boolean | Enable/disable Interleaved 2 of 5 symbology. Maps to I25_ENABLE. |
| ean8 | Boolean | Enable/disable EAN8 symbology. Maps to EAN8_ENABLE. |
| ean13 | Boolean | Enable/disable EAN13 symbology. Maps to EAN13_ENABLE. |
| code128 | Boolean | Enable/disable CODE128 symbology. Maps to CODE128_ENABLE. |
| gs1dataBar | Boolean | Enable/disable GS1 DataBar-14 symbology. Maps to GS1_14_ENABLE. |
| upcEanConvertGs1dataBarToUpcEan | Boolean | Enable/disable converting GS1 DataBar-14 to GS1-128. Maps to GS1_14_GS1_128_MODE. |
| qrCode | Boolean | Enable/disable QR Code symbology. Maps to QRCODE_ENABLE. |
| microQr | Boolean | Enable/disable Micro QR Code symbology. Maps to MICRO_QR_ENABLE. |
enumerate
enumerate(): { result: [{ __rhoID: "DATALOGIC", __rhoClass: "Rho.Barcode", id: "DATALOGIC", scannerType": "IMAGER", friendlyName: "2D Imager" }]}
On a Zebra device, it would return a list of available scan engines. On a Datalogic device it is simply hard coded to return a value because it doesn't have a functional use.
Returns
Hard coded result indicating the scanner is Datalogic.
Example
var scannerType = Rho.Barcode.enumerate()[0].getProperty("scannerType");
setDefault
setDefault(scanner: Object): Void
On a Zebra device, set the scanner to listen to. On a Datalogic device it has no meaning, it performs a no op.
Parameters
- scanner: scan object usually retrieved from enumerate
Example
Rho.Barcode.setDefault(Rho.Barcode.enumerate()[0]);
disable
disable(): Void
Disables all registered scan listeners of the Browser. Maps to BarcodeManager.release().
Example
Rho.Barcode.disable()
enable
enable(propertyMap: Object, callback: Function): Void
Registers the callback function to be triggered on scan received scan data. Object argument ignored. Uses BarcodeManger.addReadListener.
Parameters
- propertyMap: An object of properties applied, it is ignored.
- callback: Function to call when a scan event occurs. The callback function receives a single parameter, which is an object representing the scanned result. It contains the following properties:
- data - Scan data retrieved from the scan event.
- source - Symbology name, mapped to Zebra name. Mapping is not complete.
- type - Symbology ID, mapped to Zebra's value. Mapping is not complete.
- time - Hard coded to be "TEST".
- length - Hard coded to be "TEST".
- direction - Hard coded to be "TEST".
Example
function MyFunction(scanData) { /* Do something with scanData */ }
Rho.Barcode.enable({}, MyFunction);
allDecoders
allDecoders: Boolean
Enable/disable all symbologies. Maps to BarcodeManager.enableAllSymbologies.
Example
Rho.Barcode.allDecoders = true;
pdf417
pdf417: Boolean
Enable/disable PDF417 symbology. Maps to PDF417_ENABLE.
Example
Rho.Barcode.pdf417 = true;
upca
upca: Boolean
Enable/disable UPCA symbology. Maps to UPCA_ENABLE.
Example
Rho.Barcode.upca = true;
upce0
upce0: Boolean
Enable/disable UPCE symbology. Maps to UPCE_ENABLE.
Example
Rho.Barcode.upce0 = true;
msi
msi: Boolean
Enable/disable MSI symbology. Maps to MSI_ENABLE.
Example
Rho.Barcode.msi = true;
msiReportCheckDigit
msiReportCheckDigit: Boolean
Enable/disable MSI Send Checksum. Maps to MSI_SEND_CHECK.
Example
Rho.Barcode.msiReportCheckDigit = true;
i2of5
i2of5: Boolean
Enable/disable Interleaved 2 of 5 symbology. Maps to I25_ENABLE.
Example
Rho.Barcode.i2of5 = true;
ean8
ean8: Boolean
Enable/disable EAN8 symbology. Maps to EAN8_ENABLE.
Example
Rho.Barcode.ean8 = true;
ean13
ean13: Boolean
Enable/disable EAN13 symbology. Maps to EAN13_ENABLE.
Example
Rho.Barcode.ean13 = true;
code128
code128: Boolean
Enable/disable CODE128 symbology. Maps to CODE128_ENABLE.
Example
Rho.Barcode.code128 = true;
gs1dataBar
gs1dataBar: Boolean
Enable/disable GS1 DataBar-14 symbology. Maps to GS1_14_ENABLE.
Example
Rho.Barcode.gs1dataBar = true;
upcEanConvertGs1dataBarToUpcEan
upcEanConvertGs1dataBarToUpcEan: Boolean
Enable/disable converting GS1 DataBar-14 to GS1-128. Maps to GS1_14_GS1_128_MODE.
Example
Rho.Barcode.upcEanConvertGs1dataBarToUpcEan = true;
qrCode
qrCode: Boolean
Enable/disable QR Code symbology. Maps to QRCODE_ENABLE.
Example
Rho.Barcode.qrCode = true;
microQr
microQr: Boolean
Enable/disable Micro QR Code symbology. Maps to MICRO_QR_ENABLE.
Example
Rho.Barcode.microQr = true;
Application
| Method | Mapped Action |
|---|---|
| quit | Quits the application. No Datalogic JavaScript SDK equivalent. |
quit
quit(): Void
Quits the application. No Datalogic JavaScript SDK equivalent.
Example
Rho.Application.quit();
Notification
| Method | Mapped Action |
|---|---|
| playFile | Plays a wav file at the given file path. e.g. '/sdcard/Music/infbeg.wav'. No Datalogic JavaScript SDK equivalent. |
| beep | Creates a beep sound from a given JSON object. e.g. { frequency: 3000, volume: 2, duration: 1000 }. No Datalogic JavaScript SDK equivalent. |
playfile
playFile(path: String): Void
Plays a wav file at the given file path. e.g. '/sdcard/Music/infbeg.wav'. No Datalogic JavaScript SDK equivalent.
Parameters
- path: file path from sdcard to the wav file.
Example
Rho.Notification.playFile('/sdcard/Music/myFile.wav');
beep
beep(data: JSON): Void
Creates a beep sound from a given JSON object. e.g. { frequency: 3000, volume: 2, duration: 1000 }. No Datalogic JavaScript SDK equivalent.
Parameters
- data: object including
- frequency: Maps to the following tones:
- 0 - 1000 -> ToneGenerator.TONE_PROP_BEEP
- 1000 - 3000 -> ToneGenerator.TONE_PROP_ACK
- 3000 - 5000 -> ToneGenerator.TONE_CDMA_HIGH_L
- volume: Maps to the following volume percentage:
- 0 -> 0%
- 1 -> 33%
- 2 -> 66%
- 3 -> 100%
- duration - length of beep tone in milliseconds.
- frequency: Maps to the following tones:
Example
Rho.Notification.beep({ frequency: 3000, volume: 2, duration: 1000 });