|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectamlib.hw.HardwareInterface
public class HardwareInterface
| Field Summary | |
|---|---|
static int |
DBG_BUFFER
|
static int |
DBG_DBG
|
static int |
DBG_ERROR
|
static int |
DBG_INFO
|
static int |
DBG_NONE
|
static int |
DBG_WARN
|
| Constructor Summary | |
|---|---|
HardwareInterface(HWType Type)
Constructor |
|
| Method Summary | |
|---|---|
boolean |
Close()
To close hardware interface |
HWType |
getHWType()
To get the Hardware type |
int |
getMaxRxPkLength()
To get maximum data length for each Rx packet. |
int |
getMaxTxPkLength()
To get maximum data length for each Tx packet. |
java.lang.Object |
getmDevObj()
To get the casted hardware interface instance (UsbDevice for instance)which has been stored |
boolean |
getSerialNumber(byte[] pBuff,
byte[] Len)
|
boolean |
Init(android.hardware.usb.UsbManager Manager,
android.hardware.usb.UsbDevice Device)
To initial the hardware for communication |
boolean |
IsDevSet()
|
boolean |
Rx(byte[] pBuff,
int[] Len)
To receive data from hardware interface |
void |
setLog(android.content.Context ctx,
boolean enable,
int level)
To setup configurations of Hardware debug message |
boolean |
Tx(byte[] pBuff,
int Len)
To transfer data to hardware interface |
boolean |
usbGetDesc(byte[] pDesc,
int requestType,
int request,
int value,
int index,
byte[] pBuffer,
int[] pLength)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DBG_NONE
public static final int DBG_ERROR
public static final int DBG_WARN
public static final int DBG_INFO
public static final int DBG_DBG
public static final int DBG_BUFFER
| Constructor Detail |
|---|
public HardwareInterface(HWType Type)
Type - Type of hardware, eUSB is the only option currently.HWType| Method Detail |
|---|
public boolean Init(android.hardware.usb.UsbManager Manager,
android.hardware.usb.UsbDevice Device)
throws java.lang.IllegalArgumentException
Manager - UsbManagerDevice - UsbDevice which smart card belong to
java.lang.IllegalArgumentExceptionUsbManager,
UsbDevicepublic boolean Close()
public boolean Tx(byte[] pBuff,
int Len)
throws java.io.IOException,
java.lang.IllegalArgumentException
pBuff - data to transfer, the length of pBuffer is specified in parameter 'Len'Len - length of data to transfer
java.io.IOException
java.lang.IllegalArgumentException
public boolean Rx(byte[] pBuff,
int[] Len)
throws java.io.IOException,
java.lang.IllegalArgumentException
pBuff - data to receive. Be aware that providing a buffer with enough size.Len - length of received data
java.io.IOException
java.lang.IllegalArgumentException
public boolean getSerialNumber(byte[] pBuff,
byte[] Len)
throws java.io.IOException,
java.lang.IllegalArgumentException
java.io.IOException
java.lang.IllegalArgumentException
public boolean usbGetDesc(byte[] pDesc,
int requestType,
int request,
int value,
int index,
byte[] pBuffer,
int[] pLength)
public java.lang.Object getmDevObj()
Objectpublic boolean IsDevSet()
public HWType getHWType()
HWTypepublic int getMaxTxPkLength()
public int getMaxRxPkLength()
public void setLog(android.content.Context ctx,
boolean enable,
int level)
ctx - application context. It is required when manipulating over Class File.enable - set to 'true' to save log into external storage.level - debug level
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||