public abstract class ReaderDevice extends java.lang.Object implements DataManSystem.OnConnectedListener, DataManSystem.OnDisconnectedListener, DataManSystem.OnConnectionErrorListener, com.cognex.mobile.barcode.sdk.resultcollector.ResultCollector.ResultCollectorListener
getPhoneCameraDevice() or getMXDevice() factory methods.| Modifier and Type | Class and Description |
|---|---|
static class |
ReaderDevice.Availability
Enum values for
ReaderDevice availability |
static interface |
ReaderDevice.OnConnectionCompletedListener
Interface definition for monitoring the state of connection process
|
static interface |
ReaderDevice.OnDeviceBatteryLevelListener
Interface definition for device battery level callback
|
static interface |
ReaderDevice.OnLightsListener
Interface definition for lights state information callback
|
static interface |
ReaderDevice.OnResetConfigListener
Interface definition for device reset callback
|
static interface |
ReaderDevice.OnSymbologyListener
Interface definition for symbology enabled callback
|
static interface |
ReaderDevice.ReaderDeviceListener
Interface definition for
ReaderDevice status and result listener |
static class |
ReaderDevice.Symbology
Enum values for supported barcode symbologies
|
| Modifier and Type | Method and Description |
|---|---|
void |
beep()
Plays a beep on the reader
|
void |
connect(ReaderDevice.OnConnectionCompletedListener connectionCompletedListener)
Connects to the barcode reader.
|
void |
disconnect()
Disconnects from a connected barcode reader.
|
void |
enableImage(boolean enable)
Enable or disable image results from reader
|
void |
enableImageGraphics(boolean enable)
Enable or disable SVG image graphics results from reader
|
abstract ReaderDevice.Availability |
getAvailability()
Returns the availability of the reader
|
com.cognex.dataman.sdk.ConnectionState |
getConnectionState()
Returns the current connection state of the reader
|
DataManSystem |
getDataManSystem()
Returns the DataManSystem instance for this ReaderDevice
|
void |
getDeviceBatteryLevel(ReaderDevice.OnDeviceBatteryLevelListener listener)
Retrieves the current battery percentage level of the reader.
|
static ReaderDevice |
getMXDevice(android.content.Context context)
Creates a
ReaderDevice object for a connected MX barcode reader. |
static ReaderDevice |
getPhoneCameraDevice(android.content.Context context,
int cameraMode,
int previewOptions,
android.view.ViewGroup previewContainer)
Creates a
ReaderDevice object for a Phone Camera barcode reader. |
void |
isLightsOn(ReaderDevice.OnLightsListener listener)
Retrieves whether all lights of the barcode reader are turned on or off.
|
void |
isSymbologyEnabled(ReaderDevice.Symbology symbology,
ReaderDevice.OnSymbologyListener listener)
Retrieves whether the specified symbology is enabled or disabled
|
void |
onComplexResultArrived(com.cognex.mobile.barcode.sdk.resultcollector.ComplexResult result) |
void |
onConnected(DataManSystem dataManSystem)
Called after successfully connecting to a reader.
|
void |
onConnectionError(DataManSystem dataManSystem,
java.lang.Exception exception)
Called when an error occurs while connecting to a reader.
|
void |
onDisconnected(DataManSystem dataManSystem)
Called after disconnected from a reader.
|
void |
onSimpleResultDropped(com.cognex.mobile.barcode.sdk.resultcollector.SimpleResult result) |
void |
resetConfig(ReaderDevice.OnResetConfigListener listener)
Resets the reader configurations to factory default
|
void |
setLightsOn(boolean on,
ReaderDevice.OnLightsListener listener)
Turns on or off all internal lights of the reader
|
void |
setReaderDeviceListener(ReaderDevice.ReaderDeviceListener listener)
Registers a listener for read results and connection state changes
|
void |
setSymbologyEnabled(ReaderDevice.Symbology symbology,
boolean enable,
ReaderDevice.OnSymbologyListener listener)
Enable or disable the provided symbology on the reader
|
abstract boolean |
startAvailabilityListening()
Starts device availability monitoring
|
void |
startScanning()
Starts triggering
|
abstract void |
stopAvailabilityListening()
Stops device availability monitoring
|
void |
stopScanning()
Stops triggering
|
public static ReaderDevice getMXDevice(android.content.Context context)
ReaderDevice object for a connected MX barcode reader.context - The application's environment.ReaderDevice object.public static ReaderDevice getPhoneCameraDevice(android.content.Context context, int cameraMode, int previewOptions, android.view.ViewGroup previewContainer)
ReaderDevice object for a Phone Camera barcode reader.context - The application's environment.cameraMode - The CameraMode when using the Mobile device camera.previewOptions - The PreviewOption when using the Mobile device camera.previewContainer - The container where the camera preview will be placed.ReaderDevice object.public void setReaderDeviceListener(ReaderDevice.ReaderDeviceListener listener)
listener - The ReaderDevice.ReaderDeviceListener to be registeredReaderDevice.ReaderDeviceListenerpublic abstract ReaderDevice.Availability getAvailability()
ReaderDevice.Availability state of the readerReaderDevice.Availabilitypublic abstract boolean startAvailabilityListening()
public abstract void stopAvailabilityListening()
public void enableImage(boolean enable)
enable - true to enable image resultspublic void enableImageGraphics(boolean enable)
enable - true to enable image graphics resultspublic com.cognex.dataman.sdk.ConnectionState getConnectionState()
ConnectionState of the readerConnectionStatepublic void connect(ReaderDevice.OnConnectionCompletedListener connectionCompletedListener)
connectionCompletedListener - The ReaderDevice.OnConnectionCompletedListener listener to invoke as the connection process is completed.ReaderDevice.OnConnectionCompletedListenerpublic void disconnect()
public void startScanning()
public void stopScanning()
public void beep()
public void getDeviceBatteryLevel(ReaderDevice.OnDeviceBatteryLevelListener listener)
listener - The ReaderDevice.OnDeviceBatteryLevelListener to be called as the information is availableReaderDevice.OnDeviceBatteryLevelListenerpublic void setSymbologyEnabled(ReaderDevice.Symbology symbology, boolean enable, ReaderDevice.OnSymbologyListener listener)
symbology - The ReaderDevice.Symbology to enable or disableenable - true to enable, false to disablelistener - The callback interface to call as the setting completesReaderDevice.Symbology,
ReaderDevice.OnSymbologyListenerpublic void isSymbologyEnabled(ReaderDevice.Symbology symbology, ReaderDevice.OnSymbologyListener listener)
symbology - The ReaderDevice.Symbology to checklistener - The callback to be invoked as the information is availableReaderDevice.Symbology,
ReaderDevice.OnSymbologyListenerpublic void setLightsOn(boolean on,
ReaderDevice.OnLightsListener listener)
on - true, to turn on the lights, false to turn off the lightslistener - The callback to be invoked as the method completesReaderDevice.OnLightsListenerpublic void isLightsOn(ReaderDevice.OnLightsListener listener)
listener - The callback to be invoked as the result is availableReaderDevice.OnLightsListenerpublic void resetConfig(ReaderDevice.OnResetConfigListener listener)
listener - The callback interface to be invoked as the operation completesReaderDevice.OnResetConfigListenerpublic DataManSystem getDataManSystem()
DataManSystem instancepublic void onConnected(DataManSystem dataManSystem)
DataManSystem.OnConnectedListeneronConnected in interface DataManSystem.OnConnectedListenerdataManSystem - The DataManSystem object that invoked the callback.public void onDisconnected(DataManSystem dataManSystem)
DataManSystem.OnDisconnectedListeneronDisconnected in interface DataManSystem.OnDisconnectedListenerdataManSystem - The DataManSystem object that invoked the callback.public void onConnectionError(DataManSystem dataManSystem, java.lang.Exception exception)
DataManSystem.OnConnectionErrorListeneronConnectionError in interface DataManSystem.OnConnectionErrorListenerdataManSystem - The DataManSystem object that invoked the callback.exception - The exception object representing the errorpublic void onComplexResultArrived(com.cognex.mobile.barcode.sdk.resultcollector.ComplexResult result)
onComplexResultArrived in interface com.cognex.mobile.barcode.sdk.resultcollector.ResultCollector.ResultCollectorListenerpublic void onSimpleResultDropped(com.cognex.mobile.barcode.sdk.resultcollector.SimpleResult result)
onSimpleResultDropped in interface com.cognex.mobile.barcode.sdk.resultcollector.ResultCollector.ResultCollectorListener