org.dvb.smartcard
Class SmartCardReader

java.lang.Object
  extended byorg.dvb.smartcard.SmartCardReader

public class SmartCardReader
extends java.lang.Object

Represents a physical smart card reader slot in the terminal.

Since:
MHP 1.1.3

Constructor Summary
protected SmartCardReader()
          This constructor is provided for the use of implementations and specifications which extend this specification.
 
Method Summary
 void addSmartCardReaderListener(SmartCardReaderListener listener)
          Allows the specified listener to received notifications about changes in the status of the smart card reader.
 int getSlotId()
          Each single reader is identified on the terminal with an increasing identifier.
 int getStatus()
          Retrieves current status of the smart card reader.
 boolean isSmartCardInserted()
          Allows applications to query if a smart card is inserted in the reader.
 javax.microedition.apdu.APDUConnection openDefaultConnection()
          Open connection without selecting an application, and managing channels
 void removeSmartCardReaderListener(SmartCardReaderListener listener)
          Removes specified listener: the notifications about changes in the status of the smart card reader will no longer be forwarded to the given listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmartCardReader

protected SmartCardReader()
This constructor is provided for the use of implementations and specifications which extend this specification. Applications shall not define sub-classes of this class. Implementations are not required to behave correctly if any such application defined sub-classes are used.

Method Detail

getSlotId

public int getSlotId()
Each single reader is identified on the terminal with an increasing identifier. Default identifier for single slot terminals is zero.

Returns:
int id associated to the reader

getStatus

public int getStatus()
Retrieves current status of the smart card reader. The constant values are the ones defined in SmartCardReaderEvent.

Returns:
int current status of the reader

isSmartCardInserted

public boolean isSmartCardInserted()
Allows applications to query if a smart card is inserted in the reader. True is returned also if no ATR is correctly retrieved (i.e. smart card inserted upside-down).

Returns:
boolean true if smart card is inserted in given slot

addSmartCardReaderListener

public void addSmartCardReaderListener(SmartCardReaderListener listener)
Allows the specified listener to received notifications about changes in the status of the smart card reader.

Parameters:
listener - the SmartCardReaderListener that will receive the notifications

removeSmartCardReaderListener

public void removeSmartCardReaderListener(SmartCardReaderListener listener)
Removes specified listener: the notifications about changes in the status of the smart card reader will no longer be forwarded to the given listener.

Parameters:
listener - the SmartCardReaderListener that was receiving the notifications.

openDefaultConnection

public javax.microedition.apdu.APDUConnection openDefaultConnection()
                                                             throws java.io.IOException,
                                                                    javax.microedition.io.ConnectionNotFoundException
Open connection without selecting an application, and managing channels

Returns:
the APDU connection established with the smart card in the reader
Throws:
java.io.IOException - if a connection is already opened and/or cannot be established
javax.microedition.io.ConnectionNotFoundException - if opening a connection is not admitted (i.e. for CA cards