com.atid.lib.module.barcode

## Class ATBarcode

- java.lang.Object
- - com.atid.lib.module.barcode.ATBarcode

-     public abstract class ATBarcode
      extends java.lang.Object

  The ATBarcode class provides the ability to control the Barcode module installed on the Device when the ATEAReader instance is connected to the Device.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static int` | `INFO`
    `protected static int` | `MAX_PARAM`
    `protected com.atid.lib.module.barcode.types.BarcodeType[]` | `mBarcodeNames`
    `protected byte[]` | `mDefaultOption`
    `protected boolean[]` | `mDefaultState`
    `protected com.atid.lib.module.barcode.event.ATBarcodeEventManager` | `mListeners`
    `protected com.atid.lib.module.barcode.module.ATModuleBarcode` | `mModule`
    `protected com.atid.lib.device.IReader` | `mReader`
    `protected java.lang.String` | `TAG`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ATBarcode(com.atid.lib.device.IReader reader)` Create an instance of the ATBarcode class.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addListener(IATBarcodeEventListener listener)` Add an event handler to receive events from the ATBarcode instance.
    `protected void` | `assertAction()`
    `protected void` | `assertAction(byte[] data)`
    `protected void` | `assertModule()`
    `protected void` | `assertModule(byte[] data)`
    `void` | `clearListener()` Removes all event handlers from the ATBarcode instance.
    `void` | `defaultOption()` Initializes symbol options of the barcode module to default values.
    `void` | `defaultSymbol()` Initializes all symbol states of the barcode module to default values.
    `void` | `destroy()` ATBarcode Destroys the instance and returns the resource.
    `void` | `enableAllSymbol(boolean enabled)` Enables or disables all symbol states in the barcode module.
    `byte[]` | `getBarcodeParam(byte[] names)` Returns the parameter value to the barcode module of the instrument.
    `java.lang.String` | `getBarcodeParamString(java.lang.String names)` Returns the parameters of the barcode module in string format.
    `protected byte[]` | `getBytes(com.atid.lib.module.barcode.types.BarcodeType[] names)`
    `protected abstract byte[]` | `getBytes(com.atid.lib.module.barcode.types.BarcodeType[] names, boolean[] enabled, int start, int end)`
    `protected abstract byte[]` | `getBytes(com.atid.lib.module.barcode.types.BarcodeType[] names, boolean enabled, int start, int end)`
    `protected byte[]` | `getBytes(com.atid.lib.module.barcode.types.BarcodeType[] names, int length)`
    `protected abstract byte[]` | `getBytes(com.atid.lib.module.barcode.types.BarcodeType[] names, int start, int end)`
    `protected byte[]` | `getBytes(SymbolStateList list)`
    `protected byte[]` | `getBytes(SymbolStateList list, int length)`
    `protected abstract byte[]` | `getBytes(SymbolStateList list, int start, int length)`
    `java.nio.charset.Charset` | `getCharset()` Returns The Charset to be used to decode the Barcode data ATD100 is not supported.
    `protected java.lang.String` | `getString(com.atid.lib.module.barcode.types.BarcodeType[] names)`
    `abstract com.atid.lib.module.barcode.types.BarcodePostType` | `getSymbolPostState()` Returns the post office symbol set in the barcode module.
    `SymbolStateList` | `getSymbolState()` Returns the status of all symbols in the barcode module.
    `protected abstract SymbolStateList` | `getSymbolState(byte[] data)`
    `ModuleBarcodeType` | `getType()` Returns the Barcode module type of the connected device.
    `abstract java.lang.String` | `getVersion()` The Barcode module returns the version.
    `abstract boolean` | `initMoudle()` After the Device is connected, it calls to instantiate the ATBarcode instance.
    `abstract boolean` | `isSuportSelPost()` Returns whether the barcode module can select the post office symbol.
    `void` | `PumpEvent(int event, byte[] data)` Used internally by the SDK.
    `void` | `removeListener(IATBarcodeEventListener listener)` Removes an event handler when it no longer needs to receive events from the ATBarcode instance.
    `void` | `setBarcodeParam(byte[] params)` Set the parameter value on the barcode module of the machine.
    `void` | `setBarcodeParamString(java.lang.String params)` Sets the parameters of the barcode module in string format.
    `void` | `setCharset(java.nio.charset.Charset charset)` Sets The Charset to be used to decode the Barcode data.
    `protected void` | `setException(ATException e)`
    `abstract void` | `setSymbolPostState(com.atid.lib.module.barcode.types.BarcodePostType post)` Set the post office symbol in the bar code module.
    `void` | `setSymbolState(SymbolStateList list)` Sets the symbol status of the barcode module.
    `ResultCode` | `startDecode()` Instruct the instrument to read the bar code.
    `ResultCode` | `stop()` Instructs the Device to stop the operation being performed.

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

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

- - ### Field Detail

    - #### INFO

          protected static final int INFO

      See Also:
        Constant Field Values

    - #### MAX_PARAM

          protected static final int MAX_PARAM

      See Also:
        Constant Field Values

    - #### TAG

          protected java.lang.String TAG

    - #### mModule

          protected com.atid.lib.module.barcode.module.ATModuleBarcode mModule

    - #### mReader

          protected com.atid.lib.device.IReader mReader

    - #### mBarcodeNames

          protected com.atid.lib.module.barcode.types.BarcodeType[] mBarcodeNames

    - #### mDefaultOption

          protected byte[] mDefaultOption

    - #### mDefaultState

          protected boolean[] mDefaultState

    - #### mListeners

          protected com.atid.lib.module.barcode.event.ATBarcodeEventManager mListeners

  - ### Constructor Detail

    - #### ATBarcode

          public ATBarcode(com.atid.lib.device.IReader reader)

      Create an instance of the ATBarcode class. ATD100 is not supported.

  - ### Method Detail

    - #### destroy

          public void destroy()

      ATBarcode Destroys the instance and returns the resource. ATD100 is not supported.

    - #### getType

          public ModuleBarcodeType getType()

      Returns the Barcode module type of the connected device. ATD100 is not supported.
      Returns:
        Barcode ModuleBarcodeType enumeration representing the module type.

    - #### addListener

          public void addListener(IATBarcodeEventListener listener)

      Add an event handler to receive events from the ATBarcode instance. ATD100 is not supported.
      Parameters:
        `listener` - An instance that implements the IATRfidUhfEventListener interface to receive events from RFID UHF modules.

    - #### removeListener

          public void removeListener(IATBarcodeEventListener listener)

      Removes an event handler when it no longer needs to receive events from the ATBarcode instance. ATD100 is not supported.
      Parameters:
        `listener` - An instance that implements the IATRfidUhfEventListener interface to receive events from RFID UHF modules.

    - #### clearListener

          public void clearListener()

      Removes all event handlers from the ATBarcode instance. ATD100 is not supported.

    - #### initMoudle

          public abstract boolean initMoudle()

      After the Device is connected, it calls to instantiate the ATBarcode instance. ATD100 is not supported.
      Returns:
        Returns true if the initialization of the instance succeeds, false otherwise.

    - #### startDecode

          public ResultCode startDecode()

      Instruct the instrument to read the bar code. ATD100 is not supported.
      Returns:
        The ResultCode enumeration indicating the result of executing the command.

    - #### stop

          public ResultCode stop()

      Instructs the Device to stop the operation being performed. ATD100 is not supported.
      Returns:
        The ResultCode enumeration indicating the result of executing the command.

    - #### getVersion

          public abstract java.lang.String getVersion()
                                               throws ATException

      The Barcode module returns the version. ATD100 is not supported.
      Returns:
        A string representing version information.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### defaultSymbol

          public void defaultSymbol()
                             throws ATException

      Initializes all symbol states of the barcode module to default values. ATD100 is not supported.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### defaultOption

          public void defaultOption()
                             throws ATException

      Initializes symbol options of the barcode module to default values. ATD100 is not supported. Apply zebra barcode module only. Zebra Barcode Module

      | Item | Parameter | Value
      | Interleaved 2 of 5 | Length Type | Any Length
      | Matrix 2 of 5 | Length Type | Any Length
      | Discrete 2 of 5 | Length Type | Any Length
      | Code 128 | Length Type | Any Length
      | Code 39 | Length Type | Any Length
      | Code 93 | Length Type | Any Length
      | Code 11 | Length Type | Any Length
      | Codabar | Length Type | Any Length
      | MSI | Length Type | Any Length
      | Composite | UPC Composite Mode | UPC Never Linked

      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### enableAllSymbol

          public void enableAllSymbol(boolean enabled)
                               throws ATException

      Enables or disables all symbol states in the barcode module. ATD100 is not supported.
      Parameters:
        `enabled` - A boolean indicating whether to enable or disable symbol state.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### getSymbolState

          public SymbolStateList getSymbolState()
                                         throws ATException

      Returns the status of all symbols in the barcode module. ATD100 is not supported.
      Returns:
        A SymbolStateList instance that manages the name and state of a symbol in pairs.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### setSymbolState

          public void setSymbolState(SymbolStateList list)
                              throws ATException

      Sets the symbol status of the barcode module. ATD100 is not supported.
      Parameters:
        `list` - A SymbolStateList instance that manages the name and state of a symbol in pairs.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### isSuportSelPost

          public abstract boolean isSuportSelPost()

      Returns whether the barcode module can select the post office symbol. ATD100 is not supported.
      Returns:
        Returns true if it supports selection of post office symbols, false if it does not.

    - #### getSymbolPostState

          public abstract com.atid.lib.module.barcode.types.BarcodePostType getSymbolPostState()
                                                                                        throws ATException

      Returns the post office symbol set in the barcode module. ATD100 is not supported.
      Returns:
        The BarcodePostType enumeration that indicates the selection status of the post office symbol.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### setSymbolPostState

          public abstract void setSymbolPostState(com.atid.lib.module.barcode.types.BarcodePostType post)
                                           throws ATException

      Set the post office symbol in the bar code module. ATD100 is not supported.
      Parameters:
        `post` - The BarcodePostType enumeration that indicates the selection status of the post office symbol.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### getBarcodeParam

          public byte[] getBarcodeParam(byte[] names)
                                 throws ATException

      Returns the parameter value to the barcode module of the instrument. ATD100 is not supported.
      Parameters:
        `names` - A byte array that specifies the parameter name of the bar code module to be returned.
      Returns:
        A byte array representing an array of parameter names and values corresponding to the array of parameter names in the barcode module.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### setBarcodeParam

          public void setBarcodeParam(byte[] params)
                               throws ATException

      Set the parameter value on the barcode module of the machine. ATD100 is not supported.
      Parameters:
        `params` - A byte array that specifies the parameter names and values of the barcode module to be set.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### getBarcodeParamString

          public java.lang.String getBarcodeParamString(java.lang.String names)
                                                 throws ATException

      Returns the parameters of the barcode module in string format. ATD100 is not supported.
      Parameters:
        `names` - A string that specifies the Paraemter name of the barcode module to be returned.
      Returns:
        A string that specifies the name and value of the parameter of the barcode module to be set.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### setBarcodeParamString

          public void setBarcodeParamString(java.lang.String params)
                                     throws ATException

      Sets the parameters of the barcode module in string format. ATD100 is not supported.
      Parameters:
        `params` - A string that specifies the name and value of the parameter of the barcode module to be set.
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### getCharset

          public java.nio.charset.Charset getCharset()
                                              throws ATException

      Returns The Charset to be used to decode the Barcode data ATD100 is not supported.
      Returns:
        The Charset to be used to decode the bytes
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### setCharset

          public void setCharset(java.nio.charset.Charset charset)
                          throws ATException

      Sets The Charset to be used to decode the Barcode data. ATD100 is not supported.
      Parameters:
        `charset` - The Charset to be used to decode the bytes
      Throws:
        `ATException` - An ATException exception is thrown if a failure occurs while setting data on the instrument or returning data.

    - #### assertModule

          protected void assertModule()
                               throws ATException

      Throws:
        `ATException`

    - #### assertModule

          protected void assertModule(byte[] data)
                               throws ATException

      Throws:
        `ATException`

    - #### assertAction

          protected void assertAction()
                               throws ATException

      Throws:
        `ATException`

    - #### assertAction

          protected void assertAction(byte[] data)
                               throws ATException

      Throws:
        `ATException`

    - #### setException

          protected void setException(ATException e)

    - #### PumpEvent

          public void PumpEvent(int event,
                                byte[] data)

      Used internally by the SDK.

    - #### getBytes

          protected byte[] getBytes(com.atid.lib.module.barcode.types.BarcodeType[] names)

    - #### getBytes

          protected byte[] getBytes(com.atid.lib.module.barcode.types.BarcodeType[] names,
                                    int length)

    - #### getBytes

          protected abstract byte[] getBytes(com.atid.lib.module.barcode.types.BarcodeType[] names,
                                             int start,
                                             int end)

    - #### getBytes

          protected abstract byte[] getBytes(com.atid.lib.module.barcode.types.BarcodeType[] names,
                                             boolean[] enabled,
                                             int start,
                                             int end)

    - #### getBytes

          protected abstract byte[] getBytes(com.atid.lib.module.barcode.types.BarcodeType[] names,
                                             boolean enabled,
                                             int start,
                                             int end)

    - #### getBytes

          protected byte[] getBytes(SymbolStateList list)

    - #### getBytes

          protected byte[] getBytes(SymbolStateList list,
                                    int length)

    - #### getBytes

          protected abstract byte[] getBytes(SymbolStateList list,
                                             int start,
                                             int length)

    - #### getSymbolState

          protected abstract SymbolStateList getSymbolState(byte[] data)

    - #### getString

          protected java.lang.String getString(com.atid.lib.module.barcode.types.BarcodeType[] names)