com.unitech.lib.engine

## Class BaseEngine

- java.lang.Object
- - com.unitech.lib.engine.BaseEngine

-     public class BaseEngine
      extends Object

  Provides the base functionality for interacting with a barcode reader engine.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected EngineParamID[]` | `_supportedParameterIds`
    `protected EngineParam[]` | `_supportedParameters`
    `protected IReader` | `reader`
    `protected String` | `strVersion`
    `protected String` | `TAG`
    `protected int` | `version`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BaseEngine(IReader reader, EngineModel engineModel)` Constructs a new BaseEngine object.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `assertEngineParamId(EngineParamID id)` Asserts that the specified EngineParamID is supported by the engine.
    `protected void` | `convertVersion(String version)` Convert the engine version string to an integer.
    `void` | `destroy()` Destroys the BaseEngine object and releases any resources it holds.
    `EngineModel` | `getEngineModel()` Returns the EngineModel of the engine.
    `void` | `getParameter(EngineParamID engineParamID, IParameterEventListener listener)` Get a specific engine parameter setting.
    `void` | `getParameter(int id, EngineParamID engineParamID, IParameterEventListener listener)` Get a specific engine parameter setting.
    `void` | `getParameters(EngineParamID[] engineParamIDs, IParameterEventListener listener)` Get multiple engine parameter settings.
    `void` | `getParameters(int id, EngineParamID[] engineParamIDs, IParameterEventListener listener)` Get multiple engine parameter settings.
    `EngineParamID[]` | `getSupportedParameterIds()` Returns an array of EngineParamID objects that are supported by the engine.
    `EngineParam[]` | `getSupportedParameters()` Returns an array of EngineParam objects that are supported by the engine.
    `String` | `getVersion()` Returns the version of the engine as a string.
    `void` | `pumpEvent(ProtocolEventArgs args)` Handles protocol events.
    `void` | `setParameter(EngineParam engineParam, IParameterEventListener listener)` Set an engine parameter setting.
    `void` | `setParameter(int id, EngineParam engineParam, IParameterEventListener listener)` Set an engine parameter setting.
    `void` | `setParameters(EngineParam[] engineParams, IParameterEventListener listener)` Set multiple engine parameter settings.
    `void` | `setParameters(int id, EngineParam[] engineParams, IParameterEventListener listener)` Set multiple engine parameter settings.
    `protected void` | `triggerSkipKeepAliveEvent(boolean enabled)` Triggers a parameter transfer event.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### TAG

          protected String TAG

    - #### reader

          protected final IReader reader

    - #### _supportedParameterIds

          protected EngineParamID[] _supportedParameterIds

    - #### _supportedParameters

          protected EngineParam[] _supportedParameters

    - #### strVersion

          protected String strVersion

    - #### version

          protected int version

  - ### Constructor Detail

    - #### BaseEngine

          public BaseEngine(IReader reader,
                            EngineModel engineModel)

      Constructs a new BaseEngine object.
      Parameters:
        `reader` - The IReader object to use for communication with the engine.
        `engineModel` - The EngineModel of the engine.

  - ### Method Detail

    - #### destroy

          public void destroy()

      Destroys the BaseEngine object and releases any resources it holds.

    - #### getEngineModel

          public EngineModel getEngineModel()

      Returns the EngineModel of the engine.
      Returns:
        The EngineModel of the engine.

    - #### getSupportedParameterIds

          public EngineParamID[] getSupportedParameterIds()

      Returns an array of EngineParamID objects that are supported by the engine.
      Returns:
        An array of EngineParamID objects.

    - #### getSupportedParameters

          public EngineParam[] getSupportedParameters()

      Returns an array of EngineParam objects that are supported by the engine.
      Returns:
        An array of EngineParam objects.

    - #### getVersion

          public String getVersion()

      Returns the version of the engine as a string.
      Returns:
        The version of the engine.

    - #### triggerSkipKeepAliveEvent

          protected void triggerSkipKeepAliveEvent(boolean enabled)

      Triggers a parameter transfer event.
      Parameters:
        `enabled` - Whether the parameter transfer is enabled.

    - #### pumpEvent

          public void pumpEvent(ProtocolEventArgs args)

      Handles protocol events.
      Parameters:
        `args` - The ProtocolEventArgs object containing event data.

    - #### convertVersion

          protected void convertVersion(String version)

      Convert the engine version string to an integer.
      Parameters:
        `version` - The version string.

    - #### assertEngineParamId

          protected void assertEngineParamId(EngineParamID id)
                                      throws ReaderException

      Asserts that the specified EngineParamID is supported by the engine.
      Parameters:
        `id` - The EngineParamID to check.
      Throws:
        `ReaderException` - If the EngineParamID is not supported.

    - #### getParameter

          public void getParameter(int id,
                                   EngineParamID engineParamID,
                                   IParameterEventListener listener)

      Get a specific engine parameter setting.
      Parameters:
        `id` - The request ID.
        `engineParamID` - The parameter ID.
        `listener` - The listener to receive the result.

    - #### setParameter

          public void setParameter(int id,
                                   EngineParam engineParam,
                                   IParameterEventListener listener)

      Set an engine parameter setting.
      Parameters:
        `id` - The request ID.
        `engineParam` - The parameter setting.
        `listener` - The listener to receive the result.

    - #### getParameters

          public void getParameters(int id,
                                    EngineParamID[] engineParamIDs,
                                    IParameterEventListener listener)

      Get multiple engine parameter settings.
      Parameters:
        `id` - The request ID.
        `engineParamIDs` - The parameter IDs.
        `listener` - The listener to receive the result.

    - #### setParameters

          public void setParameters(int id,
                                    EngineParam[] engineParams,
                                    IParameterEventListener listener)

      Set multiple engine parameter settings.
      Parameters:
        `id` - The request ID.
        `engineParams` - The parameter settings.
        `listener` - The listener to receive the result.

    - #### getParameter

          public void getParameter(EngineParamID engineParamID,
                                   IParameterEventListener listener)

      Get a specific engine parameter setting. (Request ID = 0)
      Parameters:
        `engineParamID` - The parameter ID.
        `listener` - The listener to receive the result.

    - #### setParameter

          public void setParameter(EngineParam engineParam,
                                   IParameterEventListener listener)

      Set an engine parameter setting. (Request ID = 1)
      Parameters:
        `engineParam` - The parameter setting.
        `listener` - The listener to receive the result.

    - #### getParameters

          public void getParameters(EngineParamID[] engineParamIDs,
                                    IParameterEventListener listener)

      Get multiple engine parameter settings. (Request ID = 0)
      Parameters:
        `engineParamIDs` - The parameter IDs.
        `listener` - The listener to receive the result.

    - #### setParameters

          public void setParameters(EngineParam[] engineParams,
                                    IParameterEventListener listener)

      Set multiple engine parameter settings. (Request ID = 1)
      Parameters:
        `engineParams` - The parameter settings.
        `listener` - The listener to receive the result.