Skip to main content

Classes

The following classes are required for the SDK.

ClassesDescription
DatalogicDeviceManagerClass manages the attached Datalogic Scanner.
DatalogicDeviceClass represents for Datalogic Scanner. It contains the Datalogic Scanner details and all functions to interact with Datalogic Scanner.
UsbScanData(

val rawData: ByteArray,

val barcodeData: String,

val barcodeType: String

)

Data class passed by onScan to retrieve scanned data from the USB Scanner.
ScaleData(

val status: String,

val weight: String,

val unit: ScaleUnit

)

Data class passed by onScale to retrieve scale data from the USB Scanner.

DatalogicDeviceManager

Management class for the Datalogic Scanner device. Used to detect USB Scanner Devices and register scanner events. USB permission is required for communicate with USB devices.

Public MethodsDescription
ArrayList < DatalogicDevice > detectDevice(context: Context)get the connected devices list and prepare the DatalogicDevice based on the product Id. Return the connected device list of ArrayList < DatalogicDevice >.
Int registerUsbListener(listener: UsbListener)Register a listener for USB Events to notify when the USB Scanner connected or disconnected.
Int unregisterUsbListener(listener: UsbListener)Unregister listener for USB Events.
Int registerStatusListener(listener: StatusListener)Register listener for device Status Changes.
Int unregisterStatusListener(listener: StatusListener)Unregistered listeners for Status event.

DatalogicDevice

Class represents for Datalogic Scanner. It contains the Datalogic Scanner details and all functions to interact with Datalogic Scanner.

Public MethodsDescription
Int openDevice(context: Context)This method opens a connection to the specified DatalogicDevice, allowing for communication with the device’s endpoints. Return 0 if the interface was successfully opened, -1 otherwise.
Int closeDevice()Close the DatalogicDevice.
Int registerUsbScanListener(listener: UsbScanListener)Register listener for USB scan event to be notified when the Scanner scans the barcodes.
Int unregisterUsbScanListener(listener: UsbScanListener)Unregister listeners for Scan event.
Int registerUsbDioListener(listener: UsbDioListener)Register listener for Usb dio event to be notified when the Dio Commands get failed.
Int unregisterUsbDioListener(listener: UsbDioListener)Unregistered listeners for dio error event.
String dioCommand (device: UsbDeviceDescriptor, commandType: DIOCmdValue,cmd: String, context: Context)Function to execute the DIO Commands and return status value (Command type and valid command value should be correct for output).
HashMap < ConfigurationFeature, String > readConfig(device: UsbDeviceDescriptor, context: Context)Function to execute the read config Commands.
HashMap < ConfigurationFeature, String > writeConfig(type: String, data: HashMap < ConfigurationFeature, String > )Function to execute the write config Commands.
ByteArray imageCaptureAuto(currentBrightness, currentContrast)Function to capture image. The parameter currentBrightness and currentContrast only is applied for HHS device.
startScale()Start to receive scale data.
stopScale()Stop to receive scale data.

UsbScanData

Data class containing the data of a scanned code. Can retrieve barcode data either as a String or an array if bytes.

Public PropertiesDescription
byte[] rawDataGet the barcode data as an array of bytes.
String barcodeDataGet the barcode data as a String.
String barcodeTypeGet the barcode ID as a String.