Interfaces
The SDK has a series of interfaces that expose abstract methods that you can overwrite to receive callbacks to events. Examples of other similar interfaces can be found in the Datalogic USB SDK: (https://datalogic.github.io/android-sdk-docs/reference/com/datalogic/decode/package-summary.html).
| Interfaces | Description |
|---|---|
| UsbListener | Listen to USB Scanner device connection events (connected or disconnected). |
| UsbScanListener | Listen to USB Scan events. |
| StatusListener | Listen to when a device status gets changed. |
| UsbDioListener | Listen to when a DIO command gets execute. |
| UsbScaleListener | Listen to USB scale events that will return the scale data. |
UsbListener
Interface with an abstract method that is triggered when a USB Scanner device is connected or disconnected with the mobile device.
| Public Abstract Methods | Description |
|---|---|
| void onDeviceAttachedListener() | Called when a USB Scanner connection event is fired. |
| void onDeviceDetachedListener() | Called when a USB Scanner disconnection event is fired. |
UsbScanListener
Interface with a single abstract method that is triggered when a USB Scanner device scans a barcode.
| Public Abstract Methods | Description |
|---|---|
| fun onScan(scanData: UsbScanData) | Called when a USB Scanner scan event is fired. Receives ScanData of the scanned barcode as an argument. |
StatusListener
Interface with abstract method that is triggered when a when a device status get changed.
| Public Abstract Methods | Description |
|---|---|
| fun onStatus(productId:String, status: DeviceStatus) | Called when a USB device status event is fired. |
| fun onError(errorStatus : Int) | Function called when error occurred. |
UsbDioListener
Interface with abstract method that is triggered when a DIO Commands get failed.
| Public Abstract Methods | Description |
|---|---|
| fun fireDioErrorEvent(errorCode: Int, message: String) | Called when a DIO Commands get failed. |
UsbScaleListener
Interface with a single abstract method that is triggered when a USB Scanner device returns the scale value.
| Public Abstract Methods | Description |
|---|---|
| fun onScale(scaleData: ScaleData) | Called when a USB Scanner scale event is fired. Receives ScaleData of the scale data as an argument. |