|
|||||||||
| 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.ctapi4ocf.CTAPICardTerminal
public class CTAPICardTerminal
Implements a CT-API card terminal for OCF.
| Field Summary | |
|---|---|
protected CardID[] |
cardIdTable
|
protected byte[] |
cardStatus
|
protected cardterminal_api |
CT
|
protected char |
ctn
|
static byte[] |
getStatus
|
protected char |
pn
|
static byte[] |
requestICC
|
protected java.lang.Object |
sync
|
protected boolean |
termopened
|
| Fields inherited from class opencard.core.terminal.CardTerminal |
|---|
address, name, slots, type |
| Constructor Summary | |
|---|---|
protected |
CTAPICardTerminal(java.lang.String name,
java.lang.String type,
java.lang.String device,
java.lang.String libname)
Create CTAPICardTerminal object |
| Method Summary | |
|---|---|
void |
close()
Close used resources |
CardID |
getCardID(int slot)
Return ATR for card in slot |
byte[] |
getStatus()
Issue STATUS command to query status of card reader slots |
protected CardID |
internalReset(int slot,
int ms)
Reset card in slot and return ATR |
protected ResponseAPDU |
internalSendAPDU(int slot,
CommandAPDU capdu,
int ms)
Send APDU to card in slot |
boolean |
isCardPresent(int slot)
Return true is slot contains a card |
void |
open()
Open card terminal connection Called from OCF during startup |
void |
poll()
Poll for status change This is called from OCF every second |
byte[] |
sendTerminalCommand(byte[] com)
Send a control command to the 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, 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 |
| Field Detail |
|---|
public static final byte[] requestICC
public static final byte[] getStatus
protected boolean termopened
protected byte[] cardStatus
protected CardID[] cardIdTable
protected java.lang.Object sync
protected cardterminal_api CT
protected char ctn
protected char pn
| Constructor Detail |
|---|
protected CTAPICardTerminal(java.lang.String name,
java.lang.String type,
java.lang.String device,
java.lang.String libname)
throws CardTerminalException
name - type - device - libname -
CardTerminalException| Method Detail |
|---|
public void open()
throws CardTerminalException
open in class CardTerminalCardTerminalException - thrown in case of initialization-errors
(e.g. couldn't setup transfer protocol between CardTerminal and reader).
public void close()
throws CardTerminalException
close in class CardTerminalCardTerminalException - thrown in case of initialization-errors
(e.g. couldn't setup transfer protocol between CardTerminal and reader).
public boolean isCardPresent(int slot)
throws CardTerminalException
isCardPresent in class CardTerminalslot - Slot number starting at 0
CardTerminalException - thrown in case of problems getting the status from CardTerminal
(or other serious problems in the terminal).
public CardID getCardID(int slot)
throws CardTerminalException
getCardID in class CardTerminalslot - slot id.
CardTerminalException - Thrown in case of problems in the card terminal.
protected CardID internalReset(int slot,
int ms)
throws CardTerminalException
internalReset in class CardTerminalslot - 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 reset
protected ResponseAPDU internalSendAPDU(int slot,
CommandAPDU capdu,
int ms)
throws CardTerminalException
internalSendAPDU in class CardTerminalslot - 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 void poll()
throws CardTerminalException
poll in interface PollableCardTerminalException - Thrown when error occurred in poll-mechanism.
public byte[] sendTerminalCommand(byte[] com)
throws CardTerminalException
sendTerminalCommand in interface TerminalCommandcom - A byte[] containing the command to be send to the card
terminal.
CardTerminalException
public byte[] getStatus()
throws CardTerminalException
CardTerminalException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||