| |
|
| java.lang.Object com.sun.cardreader.CardDevice com.sun.cardreader.PlatformCardDevice
PlatformCardDevice | public class PlatformCardDevice extends CardDevice (Code) | | Device driver for the real card reader.
|
Method Summary | |
public void | close() Closes the device. | public int | cmdReset(byte[] atr) Performs reset of device. | public int | cmdXfer(byte[] request, byte[] response) Performs data transfer to the device. | public int | getSlotCount() Gets number of slots on a device. | public void | init() Initializes the device. | public boolean | isCardChanged() Checks if the card in the selected slot was changed
since last call or since last reset. | public boolean | isSatSlot(int slotNumber) Checks if this slot is SAT slot. | public void | lock() Performs platform lock of the device. | public void | selectSlot(int slot) Selects the current slot for the subsequent transfer operations. | public void | unlock() Unlocks the device. |
close | public void close()(Code) | | Closes the device.
No exceptions thrown to avoid mess in exception handlers trying
to clean up and close the device.
|
cmdReset | public int cmdReset(byte[] atr) throws IOException(Code) | | Performs reset of device.
Parameters: atr - ATR bytes Length of ATR throws: IOException - If a reset failed. |
cmdXfer | public int cmdXfer(byte[] request, byte[] response) throws IOException(Code) | | Performs data transfer to the device.
Parameters: request - Request bytes Parameters: response - Response bytes Length of response throws: IOException - If a data transfer failed. |
getSlotCount | public int getSlotCount()(Code) | | Gets number of slots on a device.
Number of slots on a device. In case of errorreturns 0. |
isCardChanged | public boolean isCardChanged() throws IOException(Code) | | Checks if the card in the selected slot was changed
since last call or since last reset.
Always called after any transfer operation, so
implementation can check and store that status during
this operation.
true if was changed, false otherwise. throws: IOException - If something fails. |
isSatSlot | public boolean isSatSlot(int slotNumber) throws IOException(Code) | | Checks if this slot is SAT slot.
Parameters: slotNumber - Slot number true if the slot is dedicated for SAT,false otherwise throws: IOException - If an error occured. |
lock | public void lock() throws IOException(Code) | | Performs platform lock of the device. This is intended to make
sure that no other native application
uses the same device during a transaction.
throws: IOException - If a device locking failed. |
selectSlot | public void selectSlot(int slot) throws IOException(Code) | | Selects the current slot for the subsequent transfer operations.
For the one-slot devices the default slot number is 0.
Parameters: slot - Slot number throws: IOException - If a slot selection failed. |
|
|
|