Skip to main content

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).

InterfacesDescription
UsbListenerListen to USB Scanner device connection events (connected or disconnected).
UsbScanListenerListen to USB Scan events.
StatusListenerListen to when a device status gets changed.
UsbDioListenerListen to when a DIO command gets execute.
UsbScaleListenerListen 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 MethodsDescription
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 MethodsDescription
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 MethodsDescription
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 MethodsDescription
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 MethodsDescription
fun onScale(scaleData: ScaleData)Called when a USB Scanner scale event is fired. Receives ScaleData of the scale data as an argument.