public class SimulScanReader extends Object
Example Usage: List<SimulScanReaderInfo> readerInfoList = simulscanManager.getSupportedDevicesInfo(); SimulScanReader reader = simulscanManager.getDevice(readerInfoList.get(0)); reader.addDataListener(callbackObj); reader.addStatusListener(callbackObj); reader.enable(); // Set template before calling read reader.read(); reader.cancelRead(); reader.disable();
Modifier and Type | Class and Description |
---|---|
static interface |
SimulScanReader.DataListerner
An interface for notifying client applications when the scan data is
available.
|
static interface |
SimulScanReader.StatusListerner
An interface for notifying client applications to notify scan events.
|
Modifier | Constructor and Description |
---|---|
protected |
SimulScanReader(SimulScanReaderInfo readerInfo,
Context context,
EMDKServiceConnection emdkServiceConnection) |
Modifier and Type | Method and Description |
---|---|
void |
addDataListener(SimulScanReader.DataListerner dataListener)
The client can register to get data notification via callbacks.
|
void |
addStatusListener(SimulScanReader.StatusListerner statusListener)
The client can register to get status notification via callbacks.
|
void |
cancelRead()
This cancels any pending read() calls
|
void |
disable()
Disables the reader hardware.
|
void |
enable()
Enables the reader hardware.
|
SimulScanConfig |
getConfig()
Gets the current configuration settings for this reader device.
|
SimulScanReaderInfo |
getReaderInfo()
Returns information about the reader device.
|
boolean |
isEnabled()
Returns reader enabled state
|
Boolean |
isReadPending()
Another read() cannot be submitted while a read is pending.
|
void |
read()
This method initiates a SimulScan read() request.
|
protected void |
release() |
void |
removeDataListener(SimulScanReader.DataListerner dataListener)
The client can unregister to not get data notification via callbacks.
|
void |
removeStatusListener(SimulScanReader.StatusListerner statusListener)
The client can unregister to not get status notification via callbacks.
|
void |
setConfig(SimulScanConfig config)
Changes the settings for this reader device.
|
protected SimulScanReader(SimulScanReaderInfo readerInfo, Context context, EMDKServiceConnection emdkServiceConnection)
public SimulScanReaderInfo getReaderInfo()
public Boolean isReadPending()
public void enable() throws SimulScanException
Example Usage: reader.enable();
SimulScanException
- The exception will thrown if the reader enable fails.public void disable() throws SimulScanException
Example Usage: reader.disable();
SimulScanException
- The exception will thrown if the reader disable fails.public boolean isEnabled()
public SimulScanConfig getConfig() throws SimulScanException
Example Usage: reader.enable(); SimulScanConfig config = reader.getConfig();
SimulScanException
- Exception will be throw if any error occurspublic void setConfig(SimulScanConfig config) throws SimulScanException
Example Usage: SimulScanMultiTemplate template1 = new SimulScanMultiTemplate(fileUri);//fileUri points to the template SimulScanReader reader = simulscanManager.getDevice(template1.deviceIdentifier); reader.enable(); SimulScanConfig config = reader.getConfig(); config.multiTemplate = template1; reader.setConfig(config);
config
- The Parameters to use for this reader device.SimulScanException
- Exception will be throw if any error occurs while setting the parameters.public void read() throws SimulScanException
Example Usage: reader.read();
SimulScanException
- Exception will be throw if any error occurs during the read requestpublic void cancelRead() throws SimulScanException
Example Usage: reader.cancelRead();
SimulScanException
- The exception will thrown if error occurs during the cancelRead request.public void addDataListener(SimulScanReader.DataListerner dataListener)
dataListener
- The DataListerner callabck object.SimulScanException
- Exception will be throw if any error occurspublic void removeDataListener(SimulScanReader.DataListerner dataListener)
dataListener
- The DataListerner callback object to be unregisteredpublic void addStatusListener(SimulScanReader.StatusListerner statusListener)
statusListener
- The StatusListerner callback objectSimulScanException
- Exception will be throw if any error occurspublic void removeStatusListener(SimulScanReader.StatusListerner statusListener)
statusListener
- The StatusListerner callback object to be unregisteredprotected void release()