PCSC4Java  0.2
Library PCSC for Java language.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
fr.redbilled.pcscforjava.CardTerminal Class Reference

List of all members.

Public Member Functions

abstract String getName ()
abstract Card connect (String protocol) throws CardException
abstract boolean isCardPresent () throws CardException
abstract boolean waitForCardPresent (long timeout) throws CardException
abstract boolean waitForCardAbsent (long timeout) throws CardException
abstract void cancelOperation () throws CardException
abstract byte[][] getCardStatus () throws CardException

Protected Member Functions

 CardTerminal ()

Detailed Description

A Smart Card terminal, sometimes refered to as a Smart Card Reader. A CardTerminal object can be obtained by calling CardTerminals::list} or CardTerminals::getTerminal CardTerminals.getTerminal()}.

Note that physical card readers with slots for multiple cards are represented by one CardTerminal object per such slot.

See also:
CardTerminals
TerminalFactory
Since:
1.6
Author:
Andreas Sterbenz
JSR 268 Expert Group

Definition at line 46 of file CardTerminal.java.


Constructor & Destructor Documentation

Constructs a new CardTerminal object.

This constructor is called by subclasses only. Application should call CardTerminals::list list()} or CardTerminals::getTerminal getTerminal()} to obtain a CardTerminal object.

Definition at line 56 of file CardTerminal.java.


Member Function Documentation

Terminates all outstanding actions with this terminal. The only requests that you can cancel are those that require waiting for external action by the smart card or user. Any such outstanding action requests will terminate with a status indication that the action was canceled.

Exceptions:
CardExceptionif the card operation failed
abstract Card fr.redbilled.pcscforjava.CardTerminal.connect ( String  protocol) throws CardException [pure virtual]

Establishes a connection to the card. If a connection has previously established using the specified protocol, this method returns the same Card object as the previous call.

Parameters:
protocolthe protocol to use ("T=0", "T=1", or "T=CL"), or "*" to connect using any available protocol.
Exceptions:
NullPointerExceptionif protocol is null
IllegalArgumentExceptionif protocol is an invalid protocol specification
CardNotPresentExceptionif no card is present in this terminal
CardExceptionif a connection could not be established using the specified protocol or if a connection has previously been established using a different protocol
SecurityExceptionif a SecurityManager exists and the caller does not have the required CardPermission permission}

Here is the caller graph for this function:

abstract byte [][] fr.redbilled.pcscforjava.CardTerminal.getCardStatus ( ) throws CardException [pure virtual]

Gets the status of the card in this card terminal.

Returns:
the status of the card in this card terminal. The first array byte of the array contains the ATR of the card. Warning the byte is NULL if there is no card in this card terminal. The second one is just a byte and contains the state of the card it must be:

SCARD_ABSENT if there is no card in the reader.

SCARD_PRESENT if there is a card in the reader, but it

has not been moved into position for use.

SCARD_SWALLOWED There is a card in the reader in position

for use. The card is not powered.

SCARD_POWERED Power is being provided to the card, but the

reader driver is unaware of the mode of the card.

SCARD_NEGOTIABLE The card has been reset and is awaiting

PTS negotiation.

SCARD_SPECIFIC The card has been reset and specific

communication protocols have been established. The third one is just a byte and contains the current protocol of the card it must be:

SCARD_PROTOCOL_RAW if raw transfer protocol is in use.

SCARD_PROTOCOL_T0 if the ISO 7816-3 T=0 protocol is in use.

SCARD_PROTOCOL_T1 if the ISO 7816-3 T=1 protocol is in use.

Exceptions:
CardExceptionif the card operation failed
abstract String fr.redbilled.pcscforjava.CardTerminal.getName ( ) [pure virtual]

Returns the unique name of this terminal.

Returns:
the unique name of this terminal.

Here is the caller graph for this function:

abstract boolean fr.redbilled.pcscforjava.CardTerminal.isCardPresent ( ) throws CardException [pure virtual]

Returns whether a card is present in this terminal.

Returns:
whether a card is present in this terminal.
Exceptions:
CardExceptionif the status could not be determined

Here is the caller graph for this function:

abstract boolean fr.redbilled.pcscforjava.CardTerminal.waitForCardAbsent ( long  timeout) throws CardException [pure virtual]

Waits until a card is absent in this terminal or the timeout expires. If the method returns due to an expired timeout, it returns false. Otherwise it return true.

If no card is present in this terminal when this method is called, it returns immediately.

Parameters:
timeoutif positive, block for up to timeout milliseconds; if zero, block indefinitely; must not be negative
Returns:
false if the method returns due to an expired timeout, true otherwise.
Exceptions:
IllegalArgumentExceptionif timeout is negative
CardExceptionif the operation failed
abstract boolean fr.redbilled.pcscforjava.CardTerminal.waitForCardPresent ( long  timeout) throws CardException [pure virtual]

Waits until a card is present in this terminal or the timeout expires. If the method returns due to an expired timeout, it returns false. Otherwise it return true.

If a card is present in this terminal when this method is called, it returns immediately.

Parameters:
timeoutif positive, block for up to timeout milliseconds; if zero, block indefinitely; must not be negative
Returns:
false if the method returns due to an expired timeout, true otherwise.
Exceptions:
IllegalArgumentExceptionif timeout is negative
CardExceptionif the operation failed

Here is the caller graph for this function:


The documentation for this class was generated from the following file: