com.datecs.rfid

## Class RC663

- java.lang.Object
- - com.datecs.rfid.RFID
  - - com.datecs.rfid.RC663

-     public class RC663
      extends RFID

  This class represents RC663 module.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `RC663.CardListener`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `CARD_SUPPORT_FELICA`
    `static int` | `CARD_SUPPORT_ISO15`
    `static int` | `CARD_SUPPORT_JEWEL`
    `static int` | `CARD_SUPPORT_NFC`
    `static int` | `CARD_SUPPORT_PICOPASS_ISO14`
    `static int` | `CARD_SUPPORT_PICOPASS_ISO15`
    `static int` | `CARD_SUPPORT_STSRI`
    `static int` | `CARD_SUPPORT_TYPE_A`
    `static int` | `CARD_SUPPORT_TYPE_B`
    `static int` | `CHANNEL_FELICA` FELICA channel.
    `static int` | `CHANNEL_ISO1443A` ISO1443A channel.
    `static int` | `CHANNEL_ISO1443B` ISO1443B channel.
    `static int` | `CHANNEL_ISO15693` ISO15693 channel.
    `static int` | `CHANNEL_MAIN` Main channel.
    `static int` | `CHANNEL_STSRI` ST SRI channel.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RC663(java.io.InputStream in, java.io.OutputStream out)` Constructs a new instance of this class.
    `RC663(java.io.InputStream in, java.io.OutputStream out, int supportedCards)` Constructs a new instance of this class.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `disable()` Powers on the RF card reader module and release associated resources.
    `void` | `enable()` Initializes and powers on the RF card reader module.
    `protected void` | `onDataReceived(byte[] data, int size)` Abstract method that is called when data is received.
    `void` | `resume()` Reinitialize RF card reader module to listen for cards.
    `void` | `setCardListener(RC663.CardListener l)` Set a callback to notify when new card available.
    `void` | `setPollingParams(int requestCode, int systemCode, int timeSlot, int detectionTime, int intervalTime)` Set polling parameter for FeliCa Card
    `byte[]` | `transmitCard(int channel, byte[] data)` Transmit command data to card.
    `byte[]` | `transmitCard(int channel, byte[] data, int length)` Transmit command data to card.

    - ### Methods inherited from class com.datecs.rfid.RFID

      `close, getLastError, setDebug, writeBlock`

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

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

- - ### Field Detail

    - #### CHANNEL_MAIN

          public static final int CHANNEL_MAIN

      Main channel.
      See Also:
        Constant Field Values

    - #### CHANNEL_ISO1443A

          public static final int CHANNEL_ISO1443A

      ISO1443A channel.
      See Also:
        Constant Field Values

    - #### CHANNEL_ISO1443B

          public static final int CHANNEL_ISO1443B

      ISO1443B channel.
      See Also:
        Constant Field Values

    - #### CHANNEL_ISO15693

          public static final int CHANNEL_ISO15693

      ISO15693 channel.
      See Also:
        Constant Field Values

    - #### CHANNEL_FELICA

          public static final int CHANNEL_FELICA

      FELICA channel.
      See Also:
        Constant Field Values

    - #### CHANNEL_STSRI

          public static final int CHANNEL_STSRI

      ST SRI channel.
      See Also:
        Constant Field Values

    - #### CARD_SUPPORT_TYPE_A

          public static final int CARD_SUPPORT_TYPE_A

      See Also:
        Constant Field Values

    - #### CARD_SUPPORT_TYPE_B

          public static final int CARD_SUPPORT_TYPE_B

      See Also:
        Constant Field Values

    - #### CARD_SUPPORT_FELICA

          public static final int CARD_SUPPORT_FELICA

      See Also:
        Constant Field Values

    - #### CARD_SUPPORT_NFC

          public static final int CARD_SUPPORT_NFC

      See Also:
        Constant Field Values

    - #### CARD_SUPPORT_JEWEL

          public static final int CARD_SUPPORT_JEWEL

      See Also:
        Constant Field Values

    - #### CARD_SUPPORT_ISO15

          public static final int CARD_SUPPORT_ISO15

      See Also:
        Constant Field Values

    - #### CARD_SUPPORT_STSRI

          public static final int CARD_SUPPORT_STSRI

      See Also:
        Constant Field Values

    - #### CARD_SUPPORT_PICOPASS_ISO14

          public static final int CARD_SUPPORT_PICOPASS_ISO14

      See Also:
        Constant Field Values

    - #### CARD_SUPPORT_PICOPASS_ISO15

          public static final int CARD_SUPPORT_PICOPASS_ISO15

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### RC663

          public RC663(java.io.InputStream in,
                       java.io.OutputStream out,
                       int supportedCards)

      Constructs a new instance of this class.
      Parameters:
        `in` - the input stream.
        `out` - the output stream.
        `supportedCards` - any combination of CARD_SUPPORT_* flags to mark which card types to be active. Enable only cards you actually plan to work with, this has high implication on power usage and detection speed.

    - #### RC663

          public RC663(java.io.InputStream in,
                       java.io.OutputStream out)

      Constructs a new instance of this class.
      Parameters:
        `in` - the input stream.
        `out` - the output stream.

  - ### Method Detail

    - #### onDataReceived

          protected void onDataReceived(byte[] data,
                                        int size)

      Description copied from class: `RFID`
      Abstract method that is called when data is received.
      Specified by:
        `onDataReceived` in class `RFID`
      Parameters:
        `data` - data buffer.
        `size` - data size.

    - #### transmitCard

          public byte[] transmitCard(int channel,
                                     byte[] data)
                              throws java.io.IOException,
                                     RFIDException

      Transmit command data to card.
      Parameters:
        `channel` - The card channel.
        `data` - The command data.
      Returns:
        The result of command execution.
      Throws:
        `java.io.IOException` - If an I/O error occurs.
        `RFIDException` - if an RF663 error occurs.

    - #### transmitCard

          public byte[] transmitCard(int channel,
                                     byte[] data,
                                     int length)
                              throws java.io.IOException,
                                     RFIDException

      Transmit command data to card.
      Parameters:
        `channel` - The card channel.
        `data` - The command data.
        `length` - The command data length.
      Returns:
        The result of command execution.
      Throws:
        `java.io.IOException` - If an I/O error occurs.
        `RFIDException` - if an RF663 error occurs.

    - #### setCardListener

          public void setCardListener(RC663.CardListener l)

      Set a callback to notify when new card available.
      Parameters:
        `l` - the callback

    - #### enable

          public void enable()
                      throws RFIDException,
                             java.io.IOException

      Initializes and powers on the RF card reader module. Call this function before any other RF card functions. The module power consumption is highly optimized, so it can be left on for extended periods of time.
      Throws:
        `java.io.IOException` - If an I/O error occurs.
        `RFIDException` - if an RF663 error occurs.

    - #### disable

          public void disable()
                       throws RFIDException,
                              java.io.IOException

      Powers on the RF card reader module and release associated resources.
      Throws:
        `RFIDException` - if RFID module error occurs.
        `java.io.IOException` - if an I/O error occurs.

    - #### resume

          public void resume()
                      throws RFIDException,
                             java.io.IOException

      Reinitialize RF card reader module to listen for cards.

      When card is detected, the RF card reader module goes in suspend mode and not looks for new cards. Calling this method resume loop again.

      It is better to call ContactlessCard.waitRemove() method.

      Throws:
        `RFIDException` - if RFID module error occurs.
        `java.io.IOException` - if an I/O error occurs.

    - #### setPollingParams

          public void setPollingParams(int requestCode,
                                       int systemCode,
                                       int timeSlot,
                                       int detectionTime,
                                       int intervalTime)
                                throws RFIDException,
                                       java.io.IOException

      Set polling parameter for FeliCa Card
      Parameters:
        `requestCode` - request code.
        `systemCode` - system code.
        `timeSlot` - time slot.
        `detectionTime` - detection time.
        `intervalTime` - interval time.
      Throws:
        `RFIDException` - if RFID module error occurs.
        `java.io.IOException` - if an I/O error occurs.