Interfaces
The SDK will have a series of interfaces that expose abstract methods that can be overwritten by the user to receive callbacks to events. Examples of other similar interfaces can be found in the existing Datalogic USB SDK here: (https://datalogic.github.io/android-sdk-docs/reference/com/datalogic/decode/package-summary.html).
Interfaces | Description |
---|---|
UsbListener | For listening to USB Scanner device connection events (connected or disconnected). |
UsbScanListener | For listening to USB Scan events. |
StatusListener | For listening to when a device status get changed. |
UsbDioListener | For listening to when a DIO Commands get execute. |
UsbScaleListener | For listening 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. |