Methods Summary |
---|
private native int | checkCardMovement0()Checks if the card in the selected slot was changed
since last call or since last reset.
Called after any transfer operation, so
implementation can check and store that status during
this operation.
|
public void | close()Closes the device.
No exceptions thrown to avoid mess in exception handlers trying
to clean up and close the device.
finalize0();
|
public int | cmdReset(byte[] atr)Performs reset of device.
int bytes_read;
if ((bytes_read = reset0(atr)) < 0) {
String err_msg = getErrorMessage0();
if (err_msg != null)
throw new IOException(err_msg);
else
throw new IOException("reset failed");
}
return bytes_read;
|
public int | cmdXfer(byte[] request, byte[] response)Performs data transfer to the device.
int bytes_read;
if ((bytes_read = cmdXfer0(request, response)) < 0) {
String err_msg = getErrorMessage0();
if (err_msg != null)
throw new IOException(err_msg);
else
throw new IOException("cmdXfer failed");
}
return bytes_read;
|
private native int | cmdXfer0(byte[] request, byte[] response)Performs data transfer to the device.
|
private native void | finalize0()Finalizes the device.
|
private native java.lang.String | getErrorMessage0()Retrives last error message.
|
public int | getSlotCount()Gets number of slots on a device.
return getSlotCount0();
|
private native int | getSlotCount0()Gets number of slots on a device.
|
public void | init()Initializes the device.
if (!init0()) {
String err_msg = getErrorMessage0();
if (err_msg != null)
throw new IOException(err_msg);
else
throw new IOException("Init failed");
}
|
private native boolean | init0()Initializes the device.
|
public boolean | isCardChanged()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.
int result = checkCardMovement0();
if (result < 0) {
String err_msg = getErrorMessage0();
if (err_msg != null)
throw new IOException(err_msg);
else
throw new IOException("Checking of card movement failed");
}
if (result == 0) {
return false;
} else {
return true;
}
|
public boolean | isSatSlot(int slotNumber)Checks if this slot is SAT slot.
int result = isSatSlot0(slotNumber);
if (result == -1) {
String err_msg = getErrorMessage0();
if (err_msg != null)
throw new IOException(err_msg);
else
throw new IOException("isSAT failed");
}
return result != 0;
|
private native int | isSatSlot0(int slotNumber)Checks if this slot is SAT slot.
|
public void | lock()Performs platform lock of the device. This is intended to make
sure that no other native application
uses the same device during a transaction.
if (!lock0()) {
String err_msg = getErrorMessage0();
if (err_msg != null)
throw new IOException(err_msg);
else
throw new IOException("Lock failed");
}
|
private native boolean | lock0()Locks the device.
|
private native int | reset0(byte[] atr)Performs reset of device.
Fills diven array with ATR bytes.
|
public void | selectSlot(int slot)Selects the current slot for the subsequent transfer operations.
For the one-slot devices the default slot number is 0.
if (!selectSlot0(slot)) {
String err_msg = getErrorMessage0();
if (err_msg != null)
throw new IOException(err_msg);
else
throw new IOException("SelectSlot failed");
}
|
private native boolean | selectSlot0(int slotIndex)Selects the current slot for the subsequent transfer operations.
For the one-slot devices the default slot number is 0.
|
public void | unlock()Unlocks the device.
if (!unlock0()) {
String err_msg = getErrorMessage0();
if (err_msg != null)
throw new IOException(err_msg);
else
throw new IOException("Unlock failed");
}
|
private native boolean | unlock0()Unlocks the device.
|