com.abc.terminalfactory

## Class AbCircleCardTerminalUSB

- java.lang.Object
- - javax.smartcardio.CardTerminal
  - - com.abc.terminalfactory.AbCircleCardTerminalUSB

-     public class AbCircleCardTerminalUSB
      extends CardTerminal

  The AbCircleCardTerminalUSB class is a wrapper class that provides a higher level of abstraction for the AbCircleCcidDeviceUsb class

- - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Card` | `connect(java.lang.String protocol)` Establishes a connection to the card.
    `java.lang.String` | `getFirmwareVersion()` Get the firmware version of the terminal
    `java.lang.String` | `getName()` Returns the unique name of this terminal.
    `boolean` | `isCardPresent()` Returns true if the card is present in the slot
    `java.lang.String` | `toString()` This function returns a string that contains the name of the usb terminal
    `boolean` | `waitForCardAbsent(long timeout)` Wait for the card to be absent
    `boolean` | `waitForCardPresent(long timeout)` Wait for a card to be present in the reader

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

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

- - ### Method Detail

    - #### getName

          public java.lang.String getName()

      Description copied from class: `CardTerminal`
      Returns the unique name of this terminal.
      Specified by:
        `getName` in class `CardTerminal`
      Returns:
        the unique name of this terminal.

    - #### connect

          public Card connect(java.lang.String protocol)
                       throws CardException

      Description copied from class: `CardTerminal`
      Establishes a connection to the card. If a connection has previously established using the specified protocol, this method returns the same Card object as the previous call.
      Specified by:
        `connect` in class `CardTerminal`
      Parameters:
        `protocol` - the protocol to use ("T=0", "T=1", or "T=CL"), or "*" to connect using any available protocol.
      Throws:
        `CardNotPresentException` - if no card is present in this terminal
        `CardException` - if a connection could not be established using the specified protocol or if a connection has previously been established using a different protocol

    - #### isCardPresent

          public boolean isCardPresent()

      Returns true if the card is present in the slot
      Specified by:
        `isCardPresent` in class `CardTerminal`
      Returns:
        The slot state.

    - #### waitForCardPresent

          public boolean waitForCardPresent(long timeout)
                                     throws CardException

      Wait for a card to be present in the reader
      Specified by:
        `waitForCardPresent` in class `CardTerminal`
      Parameters:
        `timeout` - The maximum time to wait for a card to be present.
      Returns:
        The return value is a boolean that indicates whether a card is present or not.
      Throws:
        `CardException` - if the operation failed

    - #### waitForCardAbsent

          public boolean waitForCardAbsent(long timeout)
                                    throws CardException

      Wait for the card to be absent
      Specified by:
        `waitForCardAbsent` in class `CardTerminal`
      Parameters:
        `timeout` - The maximum time to wait for the card to be absent.
      Returns:
        The return value is a boolean that indicates whether the card is present or not.
      Throws:
        `CardException` - if the operation failed

    - #### getFirmwareVersion

          public java.lang.String getFirmwareVersion()
                                              throws java.lang.IllegalAccessError

      Get the firmware version of the terminal
      Returns:
        The firmware version of the terminal.
      Throws:
        `java.lang.IllegalAccessError`

    - #### toString

          public java.lang.String toString()

      This function returns a string that contains the name of the usb terminal
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        The toString method returns a String that contains the name of the object.