com.datecs.api.rfid
Class RC663

java.lang.Object
  extended by com.datecs.api.rfid.RFID
      extended by com.datecs.api.rfid.RC663

public class RC663
extends RFID

This class represents RC663 module.


Nested Class Summary
static interface RC663.CardListener
           
 
Field Summary
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.
 
Fields inherited from class com.datecs.api.rfid.RFID
CARD_SUPPORT_FELICA, CARD_SUPPORT_ISO15, CARD_SUPPORT_JEWEL, CARD_SUPPORT_NFC, CARD_SUPPORT_STSRI, CARD_SUPPORT_TYPE_A, CARD_SUPPORT_TYPE_B
 
Constructor Summary
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
 void disable()
          Powers on the RF card reader module and release associated resources.
 void enable()
          Initializes and powers on the RF card reader module.
 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.
 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.api.rfid.RFID
close, getLastError
 
Methods inherited from class java.lang.Object
equals, 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
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

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:
RFIDException
java.io.IOException

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.