com.honeywell.decodemanager
Class DecodeManager

java.lang.Object
  extended by com.honeywell.decodemanager.DecodeManager

public class DecodeManager
extends java.lang.Object


  The DecodeManager is the entry point for the DecodeManager. This class exposes all decode functionality.

DecodeManager provides three ways to configure the barcode:

 1.Default configuration activity:

   this way provide a easy-to-use activity for user to configure the barcode property, user can utilize

 getSymConfigActivityOpeartor()to obtain the SymConfigActivityOpeartor instance. Following is the method

 that SymConfigActivityOpeartor provide:

      1. start();

      2. addSymToConfigActivity(int symbologyId);

      3. removeSymFromConfigActivity(int symbologyId);

      4. removeAllSymFromConfigActivity();

      5. restoreDefaultSymToConfigActivity();

      6. getAllSymbologyId();

      7. IsExistedInDefaultActivity(int symbologyId);

    Honeywell SDK provide sample that how to use this way,please see the Sample DecodeSampleActivity to get more details.

  this is the easiest way in three ways, However,this way provide the default UI for the user,User can not modify the UI

  style.

 2.configuration classes:

   this way provide classes to configure the barcode property,for example,User can utilize SymbologyConfigCodabar class to configure

 the codabar property. Honeywell SDK provide sample that how to use this way,please see the Sample DecodeSampleApi to get more details.

 3.configuration API

   this way provide API to configure the barcode property, for example user can use enableSymbology(int symbologyId) to enable one barcode

 use setSymbologyConfig(SymbologyConfig symConfg) to configure the options.This way is the most complex in the three ways.It is not recommended.


Nested Class Summary
 class DecodeManager.SymConfigActivityOpeartor
          The SymbologyConfigActivityOpeartor is used to operate the symbology configure activity.
 
Field Summary
static int MESSAGE_DECODER_COMPLETE
          decode barcode finish.
static int MESSAGE_DECODER_FAIL
          fail to decode the barcode.
static int MESSAGE_DECODER_READY
          Deoode is ready,then user can decode symbology and configure symbology.if not ready and be used it will throw exception
 
Constructor Summary
DecodeManager(Context context, Handler handler)
          Default Constructor.
 
Method Summary
 void cancelDecode()
          This function is used to cancel a decode action.
 int disableSymbology(int symbologyID)
          This function disables a specified symbology or all symbologies from decoding.
 void doDecode(int timeout)
          This function is used to launch a decode action.
 int enableDecodeCenteringWindow(boolean enable)
          This function is used to turn on/off center window feature.
 int enableSymbology(int symbologyID)
          This function enables a specified symbology or all symbologies from decoding.
 java.lang.String getAPIRevision()
          This method returns a string containing the Decoder.SO current revision information.
 byte getBarcodeAimID()
          This method will retrieve the AIM ID of the last successful barcode decoded.
 byte getBarcodeAimModifier()
          This method will retrieve the AIM Modifier of the last successful barcode decoded.
 byte[] getBarcodeByteData()
          This function is used to get the barcode data in a byte array.
 byte getBarcodeCodeID()
          This method will retrieve the code ID of the last successful barcode decoded.
 java.lang.String getBarcodeData()
          This method will retrieve the data for the last successful decode.
 int getBarcodeLength()
          This method will retrieve the length of the data for the last successful decode.
 int getCenteringWindowLimits(CenteringWindowLimits limits)
          This function is used to get scan window limits for current engine.
 java.lang.String getControlLogicRevision()
          This function returns a string containing the Dec Threads SOs current revision information.
 java.lang.String getDecoderRevision()
          This method returns a string containing the Decoder Interface SOs current primary decoder library revision information.
 java.lang.String getDecThreadsRevison()
          This method returns a string containing the DecThreads SOs current revision information.
 int getEngineID()
          This function will return the ID of the image engine.
 java.lang.String getEngineSerialNumber()
          This function will return the Serial Number of the scan engine.
 int getEngineType()
          This functions returns the value indicating the engine type installed, either imager or laser.
 java.lang.String getErrorMessage(int error)
          This function returns a string containing the description of the error corresponding to the input parameter error.
 int getImagerProperties(ImagerProperties imgProp)
          This method returns the details of the installed engine.
 int getLastDecodeTime()
          This method will retrieve the time in msecs that the last successful barcode decoded took.
 byte[] getLastImage(ImageAttributes imgAtt)
          This function is used to retrieve the last image the decoder processed and the properties associated with that image.
 int getMaxMessageSize()
          This function returns the size of the largest possible decode message that can be returned from the decoder.
 int getPSOCMajorRev()
          This function will return the PSOC Major Revision information.
 int getPSOCMinorRev()
          This function will return the PSOC Minor Revision information.
 java.lang.String getScanDriverRevison()
          This function returns an string containing the Scan Driver KOs current revision information.
 java.lang.String getSecondaryDecoderRevision()
          This method returns a string containing the Decoder Interface SOs current secondary decoder library revision information.
 int getSymbologyConfig(SymbologyConfig symConfig, boolean defaultValues)
          This method is used to read the configuration options for a given symbology.
 int getSymbologyMaxRange(int symbologyID)
          This function is used retrieve the maximum range value for the specified symbology.
 int getSymbologyMinRange(int symbologyID)
          This function is used retrieve the minimum range value for the specified symbology.
 DecodeManager.SymConfigActivityOpeartor getSymConfigActivityOpeartor()
          get the SymbologyConfigActivityOpeartor object that is used to operate the symbology configure activity.
 DecodeManager.SymConfigActivityOpeartor getSymConfigActivityOperator()
          get the SymbologyConfigActivityOpeartor object that is used to operate the symbology configure activity.
 void release()
          Releases all of the DecodeManager resources.
 void reloadSymbology()
          Reload symbology settings.
 int setDecodeAttemptLimit(int limit)
          This method is used to set the maximum time in msec the decoder is allowed to decode a possible barcode for a given image.Not support now.
 int setDecodeCenteringWindow(CenteringWindow window)
          This function is used to set scan window limits for current engine.
 int setDecodeSearchLimit(int limit)
          This method is used to set the maximum time in msec the decoder is allowed to find a possible barcode for a given image.
 int setExposureMode(int mode)
          This function is used to set the exposure mode to be used during scanning.
 int setLightMode(int mode)
          This function is used to set the lights mode to be used during scanning.
 int setOCRTemplates(int templates)
          This method is used to select which OCR templates will be used while attempting to decode OCR characters.
 int setOCRUserTemplate(int mode, byte[] template)
          This function is used to define the format of the user template that will be user during OCR decoding when the User Template is one of the templates enabled via the SetOCRTemplates method.
 int setProperty(int property, int value)
          This is a restricted API and users should not attempt to use it within their applications.
 int setScanMode(int mode)
          This function is used to set the scan mode to be used by the decoder stack.
 int setSymbologyConfig(SymbologyConfig symConfg)
          This function is used to configure the options for a given symbology.
 int setSymbologyConfigs(SymbologyConfigs symConfg)
          This function is used to configure multi-symbologyConfig at the same time.
 int setSymbologyDefaults(int symbologyID)
          This function is used to set the decode parameters for a given symbology to their default values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MESSAGE_DECODER_COMPLETE

public static final int MESSAGE_DECODER_COMPLETE
decode barcode finish.

See Also:
Constant Field Values

MESSAGE_DECODER_FAIL

public static final int MESSAGE_DECODER_FAIL
fail to decode the barcode.

See Also:
Constant Field Values

MESSAGE_DECODER_READY

public static final int MESSAGE_DECODER_READY
Deoode is ready,then user can decode symbology and configure symbology.if not ready and be used it will throw exception

See Also:
Constant Field Values
Constructor Detail

DecodeManager

public DecodeManager(Context context,
                     Handler handler)
Default Constructor.

Parameters:
context - - Interface to global information about user application environment
handler - - 1 It is used to receive the message of decode result - 2 It is used to receive the message of status of decode,if it is ready then user can decode symbology and configure symbology. - 3 if null the user can not receive the message and can not know when the decode is ready.
Method Detail

release

public void release()
             throws java.io.IOException
Releases all of the DecodeManager resources.

Throws:
java.io.IOException

reloadSymbology

public void reloadSymbology()
Reload symbology settings.


getSymConfigActivityOpeartor

public DecodeManager.SymConfigActivityOpeartor getSymConfigActivityOpeartor()
get the SymbologyConfigActivityOpeartor object that is used to operate the symbology configure activity.


getSymConfigActivityOperator

public DecodeManager.SymConfigActivityOpeartor getSymConfigActivityOperator()
get the SymbologyConfigActivityOpeartor object that is used to operate the symbology configure activity.


getErrorMessage

public java.lang.String getErrorMessage(int error)
                                 throws RemoteException
This function returns a string containing the description of the error corresponding to the input parameter error.

Parameters:
error - A value returned from another API function call.Error code to be translated
Returns:
Upon successful return, this string is filled in with text describing the error identified by the error parameter.
Throws:
RemoteException

getMaxMessageSize

public int getMaxMessageSize()
                      throws RemoteException
This function returns the size of the largest possible decode message that can be returned from the decoder.

Parameters:
none -
Returns:
Upon successful return, this variable points to the number of bytes required for the largest possible decode message.
Throws:
RemoteException

getEngineID

public int getEngineID()
                throws RemoteException
This function will return the ID of the image engine.

Parameters:
none -
Returns:
The ID of installed image engine.
Throws:
RemoteException

getEngineType

public int getEngineType()
                  throws RemoteException
This functions returns the value indicating the engine type installed, either imager or laser.

Parameters:
none -
Returns:
The type of the installed scan engine. @see com.honeywell.decodemanager.barcode.CommonDefine.EngineType
Throws:
RemoteException

getEngineSerialNumber

public java.lang.String getEngineSerialNumber()
                                       throws RemoteException
This function will return the Serial Number of the scan engine.

Parameters:
none -
Returns:
The Serial Number of the installed scan engine.
Throws:
RemoteException

getAPIRevision

public java.lang.String getAPIRevision()
                                throws RemoteException
This method returns a string containing the Decoder.SO current revision information.

Parameters:
none -
Returns:
Upon successful return, this string is filled in with the revision information of the Decoder.SO.
Throws:
RemoteException

getDecoderRevision

public java.lang.String getDecoderRevision()
                                    throws RemoteException
This method returns a string containing the Decoder Interface SOs current primary decoder library revision information.

Parameters:
none -
Returns:
Upon successful return, this string is filled with the Decoder Interface SOs current primary decoder library revision information.
Throws:
RemoteException

getSecondaryDecoderRevision

public java.lang.String getSecondaryDecoderRevision()
                                             throws RemoteException
This method returns a string containing the Decoder Interface SOs current secondary decoder library revision information.

Parameters:
none -
Returns:
Upon successful return, this string is filled with the Decoder Interface SOs current secondary decoder library revision information.
Throws:
RemoteException

getControlLogicRevision

public java.lang.String getControlLogicRevision()
                                         throws RemoteException
This function returns a string containing the Dec Threads SOs current revision information.

Parameters:
none -
Returns:
Upon successful return, this string is filled with the Dec Threads SOs current revision information.
Throws:
RemoteException

getDecThreadsRevison

public java.lang.String getDecThreadsRevison()
                                      throws RemoteException
This method returns a string containing the DecThreads SOs current revision information.

Parameters:
none -
Returns:
Upon successful return, this string is filled with the DecThreads SOs current revision information.
Throws:
RemoteException

getScanDriverRevison

public java.lang.String getScanDriverRevison()
                                      throws RemoteException
This function returns an string containing the Scan Driver KOs current revision information.

Parameters:
none -
Returns:
Upon successful return, this string is filled in with the revision level of the scan driver KOs.
Throws:
RemoteException

getPSOCMajorRev

public int getPSOCMajorRev()
                    throws RemoteException
This function will return the PSOC Major Revision information.

Parameters:
none -
Returns:
The PSOC major revision information.
Throws:
RemoteException

getPSOCMinorRev

public int getPSOCMinorRev()
                    throws RemoteException
This function will return the PSOC Minor Revision information.

Parameters:
none -
Returns:
The PSOC minor revision information.
Throws:
RemoteException

enableSymbology

public int enableSymbology(int symbologyID)
                    throws RemoteException
This function enables a specified symbology or all symbologies from decoding.

Parameters:
symbologyID - One of the com.honeywell.decodecommon.barcode.CommonDefine.SymbologyID , eg SYM_CODE39. To enable all symbolgies at once, SYM_ALL should be used as the SymID.
Returns:
Return 0 if you successfully enable a symbology. Otherwise, error occurs.
Throws:
RemoteException
See Also:
CommonDefine.SymbologyID, CommonDefine.ErrorCode

disableSymbology

public int disableSymbology(int symbologyID)
                     throws RemoteException
This function disables a specified symbology or all symbologies from decoding.

Parameters:
symbologyID - One of the com.honeywell.decodecommon.barcode.CommonDefine.SymbologyID , eg SYM_CODE39. To disable all symbolgies at once, SYM_ALL should be used as the SymID.
Returns:
Return 0 if you successfully disable a symbology. Otherwise, error occurs.
Throws:
RemoteException
See Also:
CommonDefine.SymbologyID, CommonDefine.ErrorCode

setSymbologyDefaults

public int setSymbologyDefaults(int symbologyID)
                         throws RemoteException
This function is used to set the decode parameters for a given symbology to their default values. To default all symbologies at once, the value SYM_ALL should be passed as the symbologyID.

Parameters:
symbologyID - One of the com.honeywell.decodecommon.barcode.CommonDefine.SymbologyID , eg SYM_CODE39. To disable all symbolgies at once, SYM_ALL should be used as the SymID.
Returns:
Return 0 if you successfully set a symbology as default symbology. Otherwise, error occurs.
Throws:
RemoteException
See Also:
CommonDefine.SymbologyID, CommonDefine.ErrorCode

getSymbologyMinRange

public int getSymbologyMinRange(int symbologyID)
                         throws RemoteException
This function is used retrieve the minimum range value for the specified symbology. If the symbology has no range values, the function returns RESULT_ERR_PARAMETER.

Parameters:
symbologyID - One of the com.honeywell.decodecommon.barcode.CommonDefine.SymbologyID , eg SYM_CODE39.
Returns:
Return 0 if you successfully get symbology min range. Otherwise, error occurs.
Throws:
RemoteException
See Also:
CommonDefine.SymbologyID, CommonDefine.ErrorCode

getSymbologyMaxRange

public int getSymbologyMaxRange(int symbologyID)
                         throws RemoteException
This function is used retrieve the maximum range value for the specified symbology. If the symbology has no range values, the function returns RESULT_ERR_PARAMETER.

Parameters:
symbologyID - One of the com.honeywell.decodecommon.barcode.CommonDefine.SymbologyID , eg SYM_CODE39.
Returns:
Return 0 if you successfully get symbolgoy max range. Otherwise, error occurs.
Throws:
RemoteException
See Also:
CommonDefine.SymbologyID, CommonDefine.ErrorCode

getImagerProperties

public int getImagerProperties(ImagerProperties imgProp)
                        throws RemoteException
This method returns the details of the installed engine.

Parameters:
imgProp - This variable is used to store the imager's property.
Returns:
Return 0 if you successfully get imager properties. Otherwise, error occurs.
Throws:
RemoteException
See Also:
CommonDefine.ErrorCode, ImagerProperties

setOCRTemplates

public int setOCRTemplates(int templates)
                    throws RemoteException
This method is used to select which OCR templates will be used while attempting to decode OCR characters.

Parameters:
templates - This value is a logical ORing of the various template option bit fields.
Returns:
Return 0 if you successfully set OCR templates. Otherwise, error occurs.
Throws:
RemoteException
See Also:
CommonDefine.ErrorCode

setOCRUserTemplate

public int setOCRUserTemplate(int mode,
                              byte[] template)
                       throws RemoteException
This function is used to define the format of the user template that will be user during OCR decoding when the User Template is one of the templates enabled via the SetOCRTemplates method.

Parameters:
mode - . @see com.honeywell.decodemanager.barcode.OCRMode
template - A byte array that contained hex values represents user template.
Returns:
Return 0 if you successfully set OCR user template. Otherwise, error occurs.
Throws:
RemoteException
See Also:
CommonDefine.ErrorCode

getSymbologyConfig

public int getSymbologyConfig(SymbologyConfig symConfig,
                              boolean defaultValues)
                       throws RemoteException
This method is used to read the configuration options for a given symbology.

Parameters:
symConfig - A specified symbology's values. @see com.honeywell.decodemanager.barcode.SymbologyConfig
defaultValues - If true,current settings will return or default settings will return.
Returns:
Return 0 if you successfully get symbologyConfig. Otherwise, error occurs.
Throws:
RemoteException
See Also:
SymbologyConfig, CommonDefine.ErrorCode

setSymbologyConfig

public int setSymbologyConfig(SymbologyConfig symConfg)
                       throws RemoteException
This function is used to configure the options for a given symbology. Options are typically min and max lengths as well as other symbology specific settings, i.e. append, number system xmit, full ASCII mode etc.

Parameters:
symConfg - A specified symbology's values. @see com.honeywell.decodemanager.barcode.SymbologyConfig
Returns:
Return 0 if you successfully set symbologyConfig. Otherwise, error occurs.
Throws:
RemoteException
See Also:
SymbologyConfig, CommonDefine.ErrorCode

setSymbologyConfigs

public int setSymbologyConfigs(SymbologyConfigs symConfg)
                        throws RemoteException
This function is used to configure multi-symbologyConfig at the same time.

Parameters:
symConfg - A array of multi-symbologyConfig. @see com.honeywell.decodemanager.SymbologyConfigs
Returns:
Return 0 if you successfully set multi-symbologyConfig. Otherwise, error occurs.
Throws:
RemoteException
See Also:
SymbologyConfigs, CommonDefine.ErrorCode

doDecode

public void doDecode(int timeout)
              throws RemoteException
This function is used to launch a decode action.

Parameters:
timeout - Maximum amount of time in milliseconds that the decoder may use to attempt to find and decode a symbol.
Throws:
RemoteException

setLightMode

public int setLightMode(int mode)
                 throws RemoteException
This function is used to set the lights mode to be used during scanning. Lights mode refers to the combination of aimer and illumination to be used.

Parameters:
mode - Desired lights mode @see com.honeywell.decodemanager.barcode.CommonDefine.LightsMode
Returns:
Return 0 if you successfully turn on or off aimer. Otherwise, error occurs.
Throws:
RemoteException
See Also:
CommonDefine.ErrorCode

setDecodeSearchLimit

public int setDecodeSearchLimit(int limit)
                         throws RemoteException
This method is used to set the maximum time in msec the decoder is allowed to find a possible barcode for a given image. Not support now.

Parameters:
limit - The maximum time in msec.
Returns:
Return 0 if you successfully set decode search limit value. Otherwise, error occurs.
Throws:
RemoteException
See Also:
CommonDefine.ErrorCode

setDecodeAttemptLimit

public int setDecodeAttemptLimit(int limit)
                          throws RemoteException
This method is used to set the maximum time in msec the decoder is allowed to decode a possible barcode for a given image.Not support now.

Parameters:
limit - The maximum time in msec.
Returns:
Return 0 if you successfully set decode attempt limit value. Otherwise, error occurs.
Throws:
RemoteException
See Also:
CommonDefine.ErrorCode

getBarcodeCodeID

public byte getBarcodeCodeID()
                      throws RemoteException
This method will retrieve the code ID of the last successful barcode decoded.

Parameters:
none -
Returns:
code ID of the last successful barcode decoded.
Throws:
RemoteException
See Also:
CommonDefine.ErrorCode

getBarcodeAimID

public byte getBarcodeAimID()
                     throws RemoteException
This method will retrieve the AIM ID of the last successful barcode decoded.

Parameters:
none -
Returns:
AIM ID of the last successful barcode decoded.
Throws:
RemoteException
See Also:
CommonDefine.ErrorCode

getBarcodeAimModifier

public byte getBarcodeAimModifier()
                           throws RemoteException
This method will retrieve the AIM Modifier of the last successful barcode decoded.

Parameters:
none -
Returns:
AIM Modifier of the last successful barcode decoded.
Throws:
RemoteException
See Also:
CommonDefine.ErrorCode

getBarcodeLength

public int getBarcodeLength()
                     throws RemoteException
This method will retrieve the length of the data for the last successful decode.

Parameters:
none -
Returns:
The length of the data for the last successful decode.
Throws:
RemoteException
See Also:
CommonDefine.ErrorCode

getBarcodeData

public java.lang.String getBarcodeData()
                                throws RemoteException
This method will retrieve the data for the last successful decode.

Parameters:
none -
Returns:
Upon successful return, this string is filled with the data for the last successful decode.
Throws:
RemoteException

getLastDecodeTime

public int getLastDecodeTime()
                      throws RemoteException
This method will retrieve the time in msecs that the last successful barcode decoded took.

Parameters:
none -
Returns:
The time in msecs that the last successful barcode decoded took.
Throws:
RemoteException

getLastImage

public byte[] getLastImage(ImageAttributes imgAtt)
                    throws RemoteException
This function is used to retrieve the last image the decoder processed and the properties associated with that image.

Parameters:
imgAtt - properties associated with the returned image.
Returns:
byte array containing image.
Throws:
RemoteException
See Also:
ImageAttributes

setExposureMode

public int setExposureMode(int mode)
                    throws RemoteException
This function is used to set the exposure mode to be used during scanning.

Parameters:
mode - Exposure mode value.@see com.honeywell.decodemanager.barcode.CommonDefine.ExposureMode
Returns:
Return 0 if you successfully turn on or off aimer. Otherwise, error occurs.
Throws:
RemoteException
See Also:
CommonDefine.ErrorCode

setScanMode

public int setScanMode(int mode)
                throws RemoteException
This function is used to set the scan mode to be used by the decoder stack. This method is rarely used by end users as it requires detailed knowledge of the various scan modes and when they should be used. It is typically used in unique situations under the guidance of the decoder team to resolve difficult customer scanning situations.

Parameters:
mode - Desired scanning mode. @see com.honeywell.decodemanager.barcode.CommonDefine.ScanMode
Returns:
Return 0 if you successfully turn on or off aimer. Otherwise, error occurs.
Throws:
RemoteException
See Also:
CommonDefine.ErrorCode

cancelDecode

public void cancelDecode()
                  throws RemoteException
This function is used to cancel a decode action.

Throws:
RemoteException

getBarcodeByteData

public byte[] getBarcodeByteData()
                          throws RemoteException
This function is used to get the barcode data in a byte array.

Returns:
Return byte array which contains barcode data .
Throws:
RemoteException

setProperty

public int setProperty(int property,
                       int value)
                throws RemoteException
This is a restricted API and users should not attempt to use it within their applications. The functionality of this interface is not guaranteed by Honeywell and may change in the future without notice.

Parameters:
property - Type for property
value - Value for property
Returns:
Return 0 if successfully set property of decoder.
Throws:
RemoteException

getCenteringWindowLimits

public int getCenteringWindowLimits(CenteringWindowLimits limits)
                             throws RemoteException
This function is used to get scan window limits for current engine.

Parameters:
limits - Contains window limits parameter
Returns:
Return result for getting windows limits .
Throws:
RemoteException

setDecodeCenteringWindow

public int setDecodeCenteringWindow(CenteringWindow window)
                             throws RemoteException
This function is used to set scan window limits for current engine.

Parameters:
window - Contains center window parameter
Returns:
Return result for setting center windows .
Throws:
RemoteException

enableDecodeCenteringWindow

public int enableDecodeCenteringWindow(boolean enable)
                                throws RemoteException
This function is used to turn on/off center window feature.

Parameters:
enable - true turn on center window; false turn off center window;
Returns:
Return result for turning on/off center window .
Throws:
RemoteException