org.simalliance.openmobileapi
Class Reader

java.lang.Object
  extended by org.simalliance.openmobileapi.Reader

public class Reader
extends java.lang.Object

Instances of this class represent Secure Element Readers connected to this device. These Readers can be physical devices or virtual devices. They can be removable or not. They can contain Secure Element that can or cannot be removed.

See Also:
SIMalliance Open Mobile API v2.02

Method Summary
 void closeSessions()
          Close all the sessions opened on this reader.
 java.lang.String getName()
          Return the user-friendly name of this reader.
 java.lang.String[] getPcscReadersName()
           
 SEService getSEService()
          Return the Secure Element service this reader is bound to.
 boolean isSecureElementPresent()
          Check if a Secure Element is present in this reader.
 Session openSession()
          Connects to a secure element in this reader.
 void setNfcTag(android.nfc.Tag tag)
           
 void setPcscReaderName(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getName

public java.lang.String getName()
Return the user-friendly name of this reader.

openSession

public Session openSession()
                    throws java.io.IOException
Connects to a secure element in this reader.
This method prepares (initialises) the Secure Element for communication before the Session object is returned (e.g. powers the Secure Element by ICC ON if its not already on). There might be multiple sessions opened at the same time on the same reader. The system ensures the interleaving of APDUs between the respective sessions.

Returns:
a Session object to be used to create Channels.
Throws:
java.io.IOException - if something went wrong with the communicating to the Secure Element or the reader.

isSecureElementPresent

public boolean isSecureElementPresent()
Check if a Secure Element is present in this reader.

Returns:
true if the SE is present, false otherwise.

getSEService

public SEService getSEService()
Return the Secure Element service this reader is bound to.

Returns:
the SEService object.

closeSessions

public void closeSessions()
Close all the sessions opened on this reader. All the channels opened by all these sessions will be closed.


getPcscReadersName

public java.lang.String[] getPcscReadersName()
                                      throws java.lang.Exception
Throws:
java.lang.Exception

setPcscReaderName

public void setPcscReaderName(java.lang.String name)

setNfcTag

public void setNfcTag(android.nfc.Tag tag)
               throws java.lang.Exception
Throws:
java.lang.Exception