|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectopencard.core.terminal.CardTerminal
de.cardcontact.opencard.terminal.jcwdpsim.JCWDPSimCardTerminal
public class JCWDPSimCardTerminal
Class implementing a SUN JCWDE simulation card terminal using T=1 protocol This class is based on the Gemplus ApduIO reference implementation. There were some necessary modifications to adapt that terminal to the new JC 2.2.2 reference implementation.
Field Summary |
---|
Fields inherited from class opencard.core.terminal.CardTerminal |
---|
address, name, slots, type |
Constructor Summary | |
---|---|
JCWDPSimCardTerminal(java.lang.String name,
java.lang.String type,
java.lang.String address,
java.lang.String host,
int port)
Constructor for JCWDPSimCardTerminal |
Method Summary | |
---|---|
void |
close()
Disable the terminal Removes the terminal from the polling registry, powers down the client interface and closes the socket |
CardID |
getCardID(int slotID)
Return the ATR of the card inserted in the specified slot. |
protected CardID |
internalReset(int slotID,
int ms)
Re-power up the card and retreives the ATR. |
protected ResponseAPDU |
internalSendAPDU(int slotID,
CommandAPDU capdu,
int ms)
Exchange APDU commands |
boolean |
isCardPresent(int slotID)
Check whether a smart card is present in a particular slot. |
void |
open()
Open the terminal - just adds the terminal to the OCF polling registry. |
void |
poll()
Updates the card inserted/removed state. |
Methods inherited from class opencard.core.terminal.CardTerminal |
---|
addSlots, cardInserted, cardRemoved, closeSlotChannel, enumerateSlots, features, getAddress, getCardID, getName, getSlot, getSlots, getType, internalCloseSlotChannel, internalFeatures, internalOpenSlotChannel, internalOpenSlotChannel, internalReset, isCardPresent, isSlotChannelAvailable, isSlotChannelAvailable, openSlotChannel, openSlotChannel, openSlotChannel, reset, reset, reset, sendAPDU, sendAPDU, sendVerifiedCommandAPDU, slots, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JCWDPSimCardTerminal(java.lang.String name, java.lang.String type, java.lang.String address, java.lang.String host, int port) throws CardTerminalException
name
- Friendly name of the terminaltype
- Type of the card terminaladdress
- Identifier for the driver to locate the terminalhost
- Host of the remote terminal simulationport
- Port number of the remote terminal simulationtimeout
-
CardTerminalException
Method Detail |
---|
public void open()
open
in class CardTerminal
CardTerminalException
- if there are problems adding the terminal to the registrypublic void close() throws CardTerminalException
close
in class CardTerminal
CardTerminalException
- Thrown in case of errors during close processpublic boolean isCardPresent(int slotID) throws CardTerminalException
isCardPresent
in class CardTerminal
slotID
- slot to check for a card.
java.lang.IndexOutOfBoundsException
- when the slotID is different from 0
CardTerminalException
- thrown in case of problems getting the status from CardTerminal
(or other serious problems in the terminal).public CardID getCardID(int slotID) throws CardTerminalException
getCardID
in class CardTerminal
slotID
- slot id.
CardTerminalException
- in case of communication problems.
java.lang.IndexOutOfBoundsException
- when the slotID is different from 0public void poll()
poll
in interface Pollable
protected CardID internalReset(int slotID, int ms) throws CardTerminalException
internalReset
in class CardTerminal
slotID
- the slot number of the slot used.ms
- A timeout in milliseconds. (ignored)
CardTerminalException
- if there is a problem during reset.protected ResponseAPDU internalSendAPDU(int slotID, CommandAPDU capdu, int ms) throws CardTerminalException
internalSendAPDU
in class CardTerminal
slotID
- The slot number of the slot used.capdu
- The CommandAPDU to send.ms
- A timeout in milliseconds. (ignored)
CardTerminalException
- if there is an error in apdu exchange
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |