com.linuxnet.jpcsc
Class State

java.lang.Object
  extended bycom.linuxnet.jpcsc.State

public class State
extends java.lang.Object

Instances of the States class are used to keep information about the states of connections with readers or cards.


Field Summary
 int dwCurrentState
          Defaults to PCSC.STATE_UNAWARE.
 int dwEventState
          Set by Context.GetStatusChange() to return the status of a reader.
 int proto
          Returned and set by Card.Status() to signal the protocol used by a card connection.
 java.lang.Object pvUserData
          Not used.
 byte[] rgbAtr
          Used by Context.getStatusChange() to store the ATR received by a card.
 java.lang.String szReader
          Name of the reader.
 
Constructor Summary
State(java.lang.String szReader)
          Constructor.
State(java.lang.String szReader, int dwCurrentState)
          Constructor.
 
Method Summary
static java.lang.String cardStateToString(int state)
          Return the symbolic representation of the status of a Card.GetStatus() operation.
 java.lang.String toString()
          Return a string representation.
 java.lang.String toString(boolean forCardGetStatus)
          Return a string representation for either a card status after a Card.GetStatus() or a reader status after a Context.getStatusChange() operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

szReader

public java.lang.String szReader
Name of the reader. Has to be set for invocations of Context.GetStatusChange() , and is returned by Card.Status().


pvUserData

public java.lang.Object pvUserData
Not used.


dwCurrentState

public int dwCurrentState
Defaults to PCSC.STATE_UNAWARE. May be set for Context.GetStatusChange() to initiate blocking on certain events. The field is also set by Card.Status() to return the state of a card connection.


dwEventState

public int dwEventState
Set by Context.GetStatusChange() to return the status of a reader.


rgbAtr

public byte[] rgbAtr
Used by Context.getStatusChange() to store the ATR received by a card. The bytearray is allocated by the underlying native code. If PCSC.STATE_ATRMATCH is passed to Context.GetStatusChange() in dwCurrentState, this array must contain the ATR of the card to be expected. The return value is still a newly created array.


proto

public int proto
Returned and set by Card.Status() to signal the protocol used by a card connection.

Constructor Detail

State

public State(java.lang.String szReader)
Constructor.

Parameters:
szReader - name of the reader, may not be null

State

public State(java.lang.String szReader,
             int dwCurrentState)
Constructor.

Parameters:
szReader - name of the reader, may not be null.
dwCurrentState - state to set for dwCurrentState.
Method Detail

toString

public java.lang.String toString(boolean forCardGetStatus)
Return a string representation for either a card status after a Card.GetStatus() or a reader status after a Context.getStatusChange() operation.


toString

public java.lang.String toString()
Return a string representation.


cardStateToString

public static java.lang.String cardStateToString(int state)
Return the symbolic representation of the status of a Card.GetStatus() operation.