|
|||||||||
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.smartcardio.SmartCardIOTerminal
public class SmartCardIOTerminal
Implements a wrapper card terminal for access to smart card with the javax.smartcardio interface.
Field Summary |
---|
Fields inherited from class opencard.core.terminal.CardTerminal |
---|
address, name, slots, type |
Constructor Summary | |
---|---|
SmartCardIOTerminal(java.lang.String name,
java.lang.String type,
java.lang.String address,
javax.smartcardio.CardTerminal ct)
|
Method Summary | |
---|---|
void |
close()
Closes the CardTerminal. |
CardID |
getCardID(int slotID)
Return the answer-to-reset (ATR) response of the card inserted in slot slotID as a CardID. |
protected CardID |
internalReset(int slot,
boolean warm)
The internal reset method may be overwritten by the actual implementation to support warm resets. |
protected CardID |
internalReset(int slot,
int ms)
The internal reset method to be provided by the concrete implementation. |
protected ResponseAPDU |
internalSendAPDU(int slot,
CommandAPDU capdu,
int ms)
The internalSendAPDU method to be provided by the concrete implementation. |
boolean |
isCardPresent(int slotID)
Check whether there is a smart card present in a particular slot. |
void |
open()
Initializes the CardTerminal. |
void |
poll()
Checks the status of the underlying terminal device. |
byte[] |
sendTerminalCommand(byte[] cmd)
Send control command to terminal. |
Methods inherited from class opencard.core.terminal.CardTerminal |
---|
addSlots, cardInserted, cardRemoved, closeSlotChannel, enumerateSlots, features, getAddress, getCardID, getName, getSlot, getSlots, getType, internalCloseSlotChannel, internalFeatures, internalOpenSlotChannel, internalOpenSlotChannel, 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 SmartCardIOTerminal(java.lang.String name, java.lang.String type, java.lang.String address, javax.smartcardio.CardTerminal ct) throws CardTerminalException
CardTerminalException
Method Detail |
---|
public void open() throws CardTerminalException
CardTerminal
open
in class CardTerminal
CardTerminalException
- thrown in case of initialization-errors
(e.g. couldn't setup transfer protocol between CardTerminal and reader).public void close() throws CardTerminalException
CardTerminal
close
in class CardTerminal
CardTerminalException
- thrown in case of initialization-errors
(e.g. couldn't setup transfer protocol between CardTerminal and reader).public CardID getCardID(int slotID) throws CardTerminalException
CardTerminal
This call should NOT block if no card is present.
getCardID
in class CardTerminal
slotID
- slot id.
CardTerminalException
- Thrown in case of problems in the card terminal.protected CardID internalReset(int slot, int ms) throws CardTerminalException
CardTerminal
internalReset
in class CardTerminal
slot
- The slot number of the slot to be resetted.ms
- To be ignored. If the card does not respond within the time
specified for the protocol an exception should be thrown.
CardTerminalException
- thrown in case of errors during resetprotected CardID internalReset(int slot, boolean warm) throws CardTerminalException
CardTerminal
internalReset
in class CardTerminal
slot
- The slot number of the slot to be resetted.
CardTerminalException
- thrown in case of errors during resetprotected ResponseAPDU internalSendAPDU(int slot, CommandAPDU capdu, int ms) throws CardTerminalException
CardTerminal
internalSendAPDU
in class CardTerminal
slot
- The slot number of the slot to be resetted.capdu
- The CommandAPDU to send.ms
- To be ignored. If the card does not respond within the time
specified for the protocol an exception should be thrown.
CardTerminalException
- thrown in case of errors in the CardTerminal (e.g. errors during data exchange)public boolean isCardPresent(int slotID) throws CardTerminalException
CardTerminal
isCardPresent
in class CardTerminal
slotID
- slot to check for a card.
CardTerminalException
- thrown in case of problems getting the status from CardTerminal
(or other serious problems in the terminal).public byte[] sendTerminalCommand(byte[] cmd) throws CardTerminalException
sendTerminalCommand
in interface TerminalCommand
cmd
- the command data
CardTerminalException
public void poll() throws CardTerminalException
Pollable
poll
in interface Pollable
CardTerminalException
- Thrown when error occurred in poll-mechanism.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |