Reader
class Reader
kotlin.Any | |
↳ | android.se.omapi.Reader |
Instances of this class represent Secure Element Readers supported 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.
Summary
Public methods | |
---|---|
Unit |
Close all the sessions opened on this reader. |
String |
getName() Return the name of this reader. |
SEService |
Return the Secure Element service this reader is bound to. |
Boolean |
Check if a Secure Element is present in this reader. |
Session |
Connects to a Secure Element in this reader. |
Public methods
closeSessions
fun closeSessions(): Unit
Close all the sessions opened on this reader. All the channels opened by all these sessions will be closed.
getName
fun getName(): String
Return the name of this reader.
- If this reader is a SIM reader, then its name must be "SIM[Slot]".
- If the reader is a SD or micro SD reader, then its name must be "SD[Slot]"
- If the reader is a embedded SE reader, then its name must be "eSE[Slot]"
Return | |
---|---|
String |
the reader name, as a String. This value cannot be null . |
getSEService
fun getSEService(): SEService
Return the Secure Element service this reader is bound to.
Return | |
---|---|
SEService |
the SEService object. This value cannot be null . |
isSecureElementPresent
fun isSecureElementPresent(): Boolean
Check if a Secure Element is present in this reader.
Return | |
---|---|
Boolean |
true if the SE is present, false otherwise. |
Exceptions | |
---|---|
java.lang.IllegalStateException |
if the service is not connected |
openSession
fun openSession(): Session
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.
Return | |
---|---|
Session |
a Session object to be used to create Channels. This value cannot be null . |
Exceptions | |
---|---|
java.io.IOException |
if something went wrong with the communicating to the Secure Element or the reader. |