public class PCSC
extends java.lang.Object
implements java.lang.Runnable
CardTerminals
Modifier and Type | Class and Description |
---|---|
static interface |
PCSC.PCSCCallbackInterface |
Constructor and Description |
---|
PCSC(android.content.Context context)
Instantiates the PCSC object that will allow you to communicate with
allowed PCSC readers.
|
PCSC(android.content.Context context,
PCSC.PCSCCallbackInterface listener)
Instantiates the PCSC object that will allow you to communicate with
allowed PCSC readers.
|
Modifier and Type | Method and Description |
---|---|
protected void |
bulkOUT(byte[] data)
Send bulk to the linked mReader
|
void |
close()
Close communication with card readers
|
void |
enableCCIDLogs(boolean enable)
Enable CCID level logs.
|
int |
getCurrentSlot()
Get the current slot number.
|
java.lang.String |
getName()
Get the current reader name.
|
android.hardware.usb.UsbDevice |
getReader()
Get current linked driver
|
java.util.List<CardTerminal> |
getTerminals()
Get the list of available terminals
|
void |
init()
Initialize the communication with reader.
|
void |
run()
USB Interrupt and bulk-in reception thread
|
protected void |
waitAPDU(int slotNumber)
Prepare to wait for an APDU transaction (ie a response from the card)
|
protected void |
waitEscape(int slotNumber)
Prepare to wait for an Escape transaction
|
protected ResponseAPDU |
waitRAPDU()
Wait for the response APDU
|
protected byte[] |
waitRESCAPE()
Wait for the response APDU
|
public PCSC(android.content.Context context, PCSC.PCSCCallbackInterface listener)
context
- mContext from the calling applicationlistener
- callback listener to receive eventspublic PCSC(android.content.Context context)
context
- mContext from the calling applicationpublic void close()
public int getCurrentSlot()
public java.util.List<CardTerminal> getTerminals()
public void enableCCIDLogs(boolean enable)
enable
- true to enable logspublic void init()
public java.lang.String getName()
public android.hardware.usb.UsbDevice getReader()
public void run()
run
in interface java.lang.Runnable
protected void bulkOUT(byte[] data)
data
- to send (raw byte[])protected void waitAPDU(int slotNumber)
slotNumber
- the card slot numberprotected void waitEscape(int slotNumber)
slotNumber
- the card slot numberprotected ResponseAPDU waitRAPDU()
protected byte[] waitRESCAPE()