com.datecs.biometric

## Class TouchChip

- java.lang.Object
- - com.datecs.biometric.TouchChip

-     public abstract class TouchChip
      extends java.lang.Object

  Implements functionality of TouchChip finger print module.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `TouchChip.Identity` The class that contains identity information.
    `static interface` | `TouchChip.ImageReceiver` A callback interface to notify when image data is received.
    `static class` | `TouchChip.Template`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `IMAGE_COMPRESSION_NONE` The image compression type.
    `static int` | `IMAGE_COMPRESSION_WSQ` WSQ compression type.
    `static int` | `IMAGE_FORMAT_ANSI` The image is in ANSI format.
    `static int` | `IMAGE_FORMAT_ISO` The image is in ISO format.
    `static int` | `IMAGE_FORMAT_RAW` The image is in RAW format.
    `static int` | `IMAGE_SIZE_LARGE` The image size is 256x360 pixels.
    `static int` | `IMAGE_SIZE_SMALL` The image size is 192x270 pixels.
    `static int` | `TEMPLATE_FORMAT_ANSI` Template in ANSI (ANSI INCITS 378-2004) format.
    `static int` | `TEMPLATE_FORMAT_ISO_FMC_C` Template in ISO_FMC_C (ISO/IEC 19794-2-2005) card format.
    `static int` | `TEMPLATE_FORMAT_ISO_FMC_N` Template in ISO_FMC_N (ISO/IEC 19794-2-2005) card format.
    `static int` | `TEMPLATE_FORMAT_ISO_FMR` Template in ISO_FMR (ISO/IEC 19794-2-2005) format
    `static int` | `TEMPLATE_FORMAT_NATIVE` Template in NATIVE (AuthenTec legacy) format.

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `TouchChip()` Constructs a new instance of this class.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `TouchChip.Identity` | `checkIdentity()` Check an identify.
    `void` | `deleteIdentity(int slot)` Delete an already enrolled template at a specified slot in the TouchChip module non-volatile memory.
    `int` | `enrolIdentity(byte[] identity)` Enrol finger print template in the TouchChip module non-volatile memory.
    `int` | `enrolIdentity(java.lang.String identity)` Enrol finger print template in the TouchChip module non-volatile memory.
    `AnsiIso` | `getIdentity(int imageSize, int imageFormat, int imageCompression, TouchChip.ImageReceiver receiver)` Gets a finger print data in different formats.
    `java.lang.String` | `getLibraryInformation()` Return TouchChip library information.
    `byte[]` | `getTemplate(int format)` Get scanned template data.
    `byte[]` | `getTemplate(int format, int slot)` Get template data from specific slot.
    `byte[]` | `getTemplate(int format, TouchChip.Template[] templates)` Get scanned template data.
    `int[]` | `listSlots()` Lists all slots in which there is an enrolled template.
    `int` | `setTemplate(int format, byte[] data)` Set template data to into TouchChip module non-volatile memory.
    `protected abstract byte[]` | `transmit(byte[] input)` Transmit packet to module.
    `void` | `wipeIdentity()` Wipe identity content.

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

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

- - ### Field Detail

    - #### IMAGE_SIZE_SMALL

          public static final int IMAGE_SIZE_SMALL

      The image size is 192x270 pixels.
      See Also:
        Constant Field Values

    - #### IMAGE_SIZE_LARGE

          public static final int IMAGE_SIZE_LARGE

      The image size is 256x360 pixels.
      See Also:
        Constant Field Values

    - #### IMAGE_FORMAT_ANSI

          public static final int IMAGE_FORMAT_ANSI

      The image is in ANSI format.
      See Also:
        Constant Field Values

    - #### IMAGE_FORMAT_ISO

          public static final int IMAGE_FORMAT_ISO

      The image is in ISO format.
      See Also:
        Constant Field Values

    - #### IMAGE_FORMAT_RAW

          public static final int IMAGE_FORMAT_RAW

      The image is in RAW format.
      See Also:
        Constant Field Values

    - #### IMAGE_COMPRESSION_NONE

          public static final int IMAGE_COMPRESSION_NONE

      The image compression type.
      See Also:
        Constant Field Values

    - #### IMAGE_COMPRESSION_WSQ

          public static final int IMAGE_COMPRESSION_WSQ

      WSQ compression type.
      See Also:
        Constant Field Values

    - #### TEMPLATE_FORMAT_NATIVE

          public static final int TEMPLATE_FORMAT_NATIVE

      Template in NATIVE (AuthenTec legacy) format.
      See Also:
        Constant Field Values

    - #### TEMPLATE_FORMAT_ANSI

          public static final int TEMPLATE_FORMAT_ANSI

      Template in ANSI (ANSI INCITS 378-2004) format.
      See Also:
        Constant Field Values

    - #### TEMPLATE_FORMAT_ISO_FMR

          public static final int TEMPLATE_FORMAT_ISO_FMR

      Template in ISO_FMR (ISO/IEC 19794-2-2005) format
      See Also:
        Constant Field Values

    - #### TEMPLATE_FORMAT_ISO_FMC_N

          public static final int TEMPLATE_FORMAT_ISO_FMC_N

      Template in ISO_FMC_N (ISO/IEC 19794-2-2005) card format.
      See Also:
        Constant Field Values

    - #### TEMPLATE_FORMAT_ISO_FMC_C

          public static final int TEMPLATE_FORMAT_ISO_FMC_C

      Template in ISO_FMC_C (ISO/IEC 19794-2-2005) card format.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### TouchChip

          protected TouchChip()

      Constructs a new instance of this class.

  - ### Method Detail

    - #### transmit

          protected abstract byte[] transmit(byte[] input)
                                      throws java.io.IOException

      Transmit packet to module.
      Parameters:
        `input` - the input data
      Returns:
        the output data.
      Throws:
        `java.io.IOException` - if an I/O error occurs.

    - #### enrolIdentity

          public int enrolIdentity(byte[] identity)
                            throws TouchChipException,
                                   java.io.IOException

      Enrol finger print template in the TouchChip module non-volatile memory.
      Parameters:
        `identity` - the template identification. The parameter can be maximum 100 symbols long.
      Returns:
        the slot under which template is enroled.
      Throws:
        `TouchChipException` - if and TouchChip error occurs.
        `java.io.IOException` - if an I/O error occurs.

    - #### enrolIdentity

          public int enrolIdentity(java.lang.String identity)
                            throws TouchChipException,
                                   java.io.IOException

      Enrol finger print template in the TouchChip module non-volatile memory.
      Parameters:
        `identity` - the template identification. The parameter can be maximum 100 characters long.
      Returns:
        the slot under which template is enrolled.
      Throws:
        `TouchChipException` - if and TouchChip error occurs.
        `java.io.IOException` - if an I/O error occurs.

    - #### deleteIdentity

          public void deleteIdentity(int slot)
                              throws TouchChipException,
                                     java.io.IOException

      Delete an already enrolled template at a specified slot in the TouchChip module non-volatile memory.
      Parameters:
        `slot` - the slot number. If slot number is 0xFF then all templates shall be deleted.
      Throws:
        `TouchChipException` - if and TouchChip error occurs.
        `java.io.IOException` - if an I/O error occurs.

    - #### checkIdentity

          public TouchChip.Identity checkIdentity()
                                           throws TouchChipException,
                                                  java.io.IOException

      Check an identify.

      The finger print is compared with the already enrolled templates and if there is a match, the number of the slot and the associated data is returned.

      Returns:
        the identity.
      Throws:
        `TouchChipException` - if and TouchChip error occurs.
        `java.io.IOException` - if an I/O error occurs.

    - #### listSlots

          public int[] listSlots()
                          throws TouchChipException,
                                 java.io.IOException

      Lists all slots in which there is an enrolled template.
      Returns:
        the array that contains enrolled slots.
      Throws:
        `TouchChipException` - if and TouchChip error occurs.
        `java.io.IOException` - if an I/O error occurs.

    - #### getIdentity

          public AnsiIso getIdentity(int imageSize,
                                     int imageFormat,
                                     int imageCompression,
                                     TouchChip.ImageReceiver receiver)
                              throws TouchChipException,
                                     java.io.IOException

      Gets a finger print data in different formats.
      Parameters:
        `imageSize` - the image size, one of IMAGE_SIZE_* constant values.
        `imageFormat` - the image format, one of IMAGE_FORMAT_* constant values.
        `imageCompression` - the compression type, one of IMAGE_COMPRESSION_* constant values.
        `receiver` - a callback interface to notify when image data is received.
      Returns:
        the finger print data.
      Throws:
        `TouchChipException` - if and TouchChip error occurs.
        `java.io.IOException` - if an I/O error occurs.

    - #### wipeIdentity

          public void wipeIdentity()
                            throws TouchChipException,
                                   java.io.IOException

      Wipe identity content.
      Throws:
        `TouchChipException` - if and TouchChip error occurs.
        `java.io.IOException` - if an I/O error occurs.

    - #### getLibraryInformation

          public java.lang.String getLibraryInformation()
                                                 throws TouchChipException,
                                                        java.io.IOException

      Return TouchChip library information.
      Returns:
        the information.
      Throws:
        `TouchChipException` - if and TouchChip error occurs.
        `java.io.IOException` - if an I/O error occurs.

    - #### getTemplate

          public byte[] getTemplate(int format)
                             throws TouchChipException,
                                    java.io.IOException

      Get scanned template data.
      Parameters:
        `format` - the template format, one of TEMPLATE_FORMAT_* constant values.
      Returns:
        the template data.
      Throws:
        `TouchChipException` - if and TouchChip error occurs.
        `java.io.IOException` - if an I/O error occurs.

    - #### getTemplate

          public byte[] getTemplate(int format,
                                    int slot)
                             throws TouchChipException,
                                    java.io.IOException

      Get template data from specific slot.
      Parameters:
        `format` - the template format, one of TEMPLATE_FORMAT_* constant values.
        `slot` - the slot number.
      Returns:
        the template data.
      Throws:
        `TouchChipException` - if and TouchChip error occurs.
        `java.io.IOException` - if an I/O error occurs.

    - #### setTemplate

          public int setTemplate(int format,
                                 byte[] data)
                          throws TouchChipException,
                                 java.io.IOException

      Set template data to into TouchChip module non-volatile memory.
      Parameters:
        `format` - the template format, one of TEMPLATE_FORMAT_* constant values.
        `data` - the template data.
      Returns:
        the slot number where template is stored.
      Throws:
        `TouchChipException` - if and TouchChip error occurs.
        `java.io.IOException` - if an I/O error occurs.

    - #### getTemplate

          public byte[] getTemplate(int format,
                                    TouchChip.Template[] templates)
                             throws TouchChipException,
                                    java.io.IOException

      Get scanned template data.

      If scanned template much any of given templates this method throws duplication check error.

      Parameters:
        `format` - the format of the returned template.
        `templates` - list of templates used for duplication check.
      Returns:
        new template.
      Throws:
        `TouchChipException` - if and TouchChip error occurs.
        `java.io.IOException` - if an I/O error occurs.