|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectacs.jni.ACR120U
public class ACR120U
ACR120U JNI Class Package provides the programming interfaces for developer to develop application for ACR120U using Java programming language. The implementation consists of a wrapper DLL developed in C++ and a Java class package that exports the programming interfaces for access to native methods implemented in the DLL.
Field Summary | |
---|---|
static short |
AC_MIFARE_LOGIN_KEYTYPE_A
This constant field defines the key type to use to login a sector of Mifare card. |
static short |
AC_MIFARE_LOGIN_KEYTYPE_B
This constant field defines the key type to use to login a sector of Mifare card. |
static short |
AC_MIFARE_LOGIN_KEYTYPE_DEFAULT_A
This constant field defines the key type to use to login a sector of Mifare card. |
static short |
AC_MIFARE_LOGIN_KEYTYPE_DEFAULT_B
This constant field defines the key type to use to login a sector of Mifare card. |
static short |
AC_MIFARE_LOGIN_KEYTYPE_DEFAULT_F
This constant field defines the key type to use to login a sector of Mifare card. |
static short |
AC_MIFARE_LOGIN_KEYTYPE_STORED_A
This constant field defines the key type to use to login a sector of Mifare card. |
static short |
AC_MIFARE_LOGIN_KEYTYPE_STORED_B
This constant field defines the key type to use to login a sector of Mifare card. |
static short |
ACR120_USB1
This constant field defines the instance of ACR120U connected to the USB port. |
static short |
ACR120_USB2
This constant field defines the instance of ACR120U connected to the USB port. |
static short |
ACR120_USB3
This constant field defines the instance of ACR120U connected to the USB port. |
static short |
ACR120_USB4
This constant field defines the instance of ACR120U connected to the USB port. |
static short |
ACR120_USB5
This constant field defines the instance of ACR120U connected to the USB port. |
static short |
ACR120_USB6
This constant field defines the instance of ACR120U connected to the USB port. |
static short |
ACR120_USB7
This constant field defines the instance of ACR120U connected to the USB port. |
static short |
ACR120_USB8
This constant field defines the instance of ACR120U connected to the USB port. |
static short |
ACR120JNI_ERROR_EXCEPTION_OCCURED
This constant field defines the error code returned by this JNI class package. |
static short |
ACR120JNI_ERROR_RECV_BUFFER_OVERFLOW
This constant field defines the error code returned by this JNI class package. |
static short |
ACR120JNI_ERROR_SEND_BUFFER_OVERFLOW
This constant field defines the error code returned by this JNI class package. |
static short |
ACR120JNI_ERROR_SUCCESS
This constant field defines the error code returned by this JNI class package. |
static int |
ACR120UJNI_14443_BUFFER_SIZE
This constant field defines the default buffer size used with ISO-14443 card. |
static int |
ACR120UJNI_DEFAULT_BUFFER_SIZE
This constant field defines the default buffer size used with Mifare card. |
static int |
ACR120UJNI_MAX_NUM_TAGS
This constant field defines the maximum number of tags that can be listed using listTags method. |
static int |
ACR120UJNI_MAX_TAG_LENGTH
This constant field defines the maximum tag length returned by a card. |
static int |
ACR120UJNI_MIFARE_BLOCK_LENGTH
This constant field defines the block length of Mifare card. |
static int |
ACR120UJNI_MIFARE_KEY_LENGTH
This constant field defines the maximum key length of Mifare card. |
Constructor Summary | |
---|---|
ACR120U()
|
Method Summary | |
---|---|
short |
close(short hReader)
Closes the connection to reader. |
short |
copy(short hReader,
byte srcBlock,
byte desBlock,
int[] pNewValue)
Copies a value block to another value block of the same sector. |
short |
dec(short hReader,
byte Block,
int Value,
int[] pNewValue)
Decrements a value of block by subtracting a value. |
short |
deselect(short hReader,
boolean typeA)
Requests an Answer-to-Select (ATS) message from the card after calling the Select method. |
short |
directReceive(short hReader,
byte RespectedDataLength,
byte[] pReceivedDataLength,
byte[] pReceivedData,
short TimedOut)
Receives data to the reader directly. |
short |
directSend(short hReader,
byte DataLength,
byte[] pData,
byte[] pResponseDataLength,
byte[] pResponseData,
short TimedOut)
Sends data to the reader directly. |
byte |
getCardOpMode()
Gets the card operation mode of ACR120U device. |
int |
getCardsSupported()
Get the supported card type of ACR120U device. |
java.lang.String |
getClassVersion()
Gets the version of this JNI wrapper class for ACR120U native methods. |
java.lang.String |
getFirmwareVersion()
Get the retrieved firmware version of ACR120U device. |
byte |
getFWI()
Gets the FWI timeout value of ACR120U device. |
byte |
getMifareInterfaceType()
Get the retrieved interface byte of ACR120U device. |
short |
inc(short hReader,
byte Block,
int Value,
int[] pNewValue)
Increments a value of block by adding a value. |
short |
initBlockNumber(short FrameLength)
Resets the block number to be used during the ISO14443 part 4 (T=CL) communication. |
short |
listTags(short hReader,
byte[] pNumTagFound,
byte[] pTagType,
byte[] pTagLength,
byte[][] pSN)
Lists out the serial numbers of all tags, which are in the readable antenna range. |
short |
login(short hReader,
byte Sector,
byte KeyType,
byte StoredNo,
byte[] pKey)
Performs an authentication to access one sector of the card. |
short |
multiTagSelect(short hReader,
byte TagLength,
byte[] SN,
byte[] pResultTagType,
byte[] pResultTagLength,
byte[] pResultSN)
Selects a TAG with specific serial number. |
short |
open(short hReaderPort)
Opens the connection to reader. |
short |
power(short hReader,
byte State)
turn on or off the antenna power. |
short |
rATS(short hReader,
byte FSDI,
byte[] atslen,
byte[] ats)
Requests an Answer-to-Select (ATS) message from the card after calling the Select method. |
short |
read(short hReader,
byte Block,
byte[] pBlockData)
Reads a block. |
short |
readEEPROM(short hReader,
byte RegNo,
byte[] pEEPROMData)
Reads the internal EEPROM of the reader. |
short |
readRC531Reg(short hReader,
byte RegNo,
byte[] Value)
Reads the Mifare register. |
short |
readUserPort(short hReader,
byte[] pUserPortState)
Reads the state of user port. |
short |
readValue(short hReader,
byte Block,
int[] pValueData)
Reads a value. |
short |
requestDLLVersion(byte[] pVersionInfoLength,
byte[] pVersionInfo)
Gets the native method DLL version information. |
short |
reset(short hReader)
Resets the Mifare chip of the reader and restore factory setting. |
short |
select(short hReader,
byte[] pResultTagType,
byte[] pResultTagLength,
byte[] pResultSN)
Selects a single card and returns the card ID (Serial Number). |
int |
setCardOpMode(byte jCardOpMode)
Sets the card operation mode retrieved from the ACR120U device. |
int |
setCardsSupported(int jCardsSupported)
Sets the supported Mifare card retrieved from the ACR120U device. |
int |
setFirmwareVersion(java.lang.String jFWVersion)
Sets the firmware version string retrieved from the ACR120U device. |
int |
setFWI(byte jFWI)
Sets the current FWI timeout value retrieved from the ACR120U device. |
int |
setMifareInterfaceType(byte jMifareInterfaceType)
Sets the interface type of Mifare card retrieved from the ACR120U device. |
short |
status(short hReader)
Retrieves the firmware version and reader status from the reader. |
short |
txDataTelegram(short hReader,
byte SendDataLength,
byte[] pSendData,
byte[] pReceivedDataLength,
byte[] pReceivedData)
Sends data to the selected card. |
short |
write(short hReader,
byte Block,
byte[] pBlockData)
Writes a block. |
short |
writeEEPROM(short hReader,
byte RegNo,
byte EEPROMData)
Writes the internal EEPROM of the reader. |
short |
writeMasterKey(short hReader,
byte KeyNo,
byte[] pKey)
Writes master keys. |
short |
writeRC531Reg(short hReader,
byte RegNo,
byte Value)
Writes the Mifare register. |
short |
writeUserPort(short hReader,
byte UserPortState)
Writes the state of user port. |
short |
writeValue(short hReader,
byte Block,
int ValueData)
Writes a value. |
short |
xchAPDU(short hReader,
boolean typeA,
short[] xLen,
byte[] xData,
short[] rLen,
byte[] rData)
Handles the APDU exchange in T=CL protocol. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final short ACR120_USB1
public static final short ACR120_USB2
public static final short ACR120_USB3
public static final short ACR120_USB4
public static final short ACR120_USB5
public static final short ACR120_USB6
public static final short ACR120_USB7
public static final short ACR120_USB8
public static final short AC_MIFARE_LOGIN_KEYTYPE_A
public static final short AC_MIFARE_LOGIN_KEYTYPE_B
public static final short AC_MIFARE_LOGIN_KEYTYPE_DEFAULT_A
public static final short AC_MIFARE_LOGIN_KEYTYPE_DEFAULT_B
public static final short AC_MIFARE_LOGIN_KEYTYPE_DEFAULT_F
public static final short AC_MIFARE_LOGIN_KEYTYPE_STORED_A
public static final short AC_MIFARE_LOGIN_KEYTYPE_STORED_B
public static final int ACR120UJNI_DEFAULT_BUFFER_SIZE
public static final int ACR120UJNI_14443_BUFFER_SIZE
public static final int ACR120UJNI_MAX_NUM_TAGS
public static final int ACR120UJNI_MAX_TAG_LENGTH
public static final int ACR120UJNI_MIFARE_KEY_LENGTH
public static final int ACR120UJNI_MIFARE_BLOCK_LENGTH
public static final short ACR120JNI_ERROR_SUCCESS
public static final short ACR120JNI_ERROR_SEND_BUFFER_OVERFLOW
public static final short ACR120JNI_ERROR_RECV_BUFFER_OVERFLOW
public static final short ACR120JNI_ERROR_EXCEPTION_OCCURED
Constructor Detail |
---|
public ACR120U()
Method Detail |
---|
public int setFirmwareVersion(java.lang.String jFWVersion)
jFWVersion
- the firmware string retrieved from the ACR120U device.
public int setMifareInterfaceType(byte jMifareInterfaceType)
jMifareInterfaceType
- the interface type retrieved from the ACR120U device.
public int setCardsSupported(int jCardsSupported)
jCardsSupported
- the supported card type retrieved from the ACR120U device.
public int setCardOpMode(byte jCardOpMode)
jCardOpMode
- the card operation mode retrieved from the ACR120U device.
public int setFWI(byte jFWI)
jFWI
- the FWI timeout vale to set.
public java.lang.String getClassVersion()
public java.lang.String getFirmwareVersion()
public byte getMifareInterfaceType()
0x01 | Type A |
0x02 | Type B |
0x03 | Type A + Type B |
public int getCardsSupported()
Bit 0 | Mifare Light |
Bit 1 | Mifare 1K |
Bit 2 | Mifare 4K |
Bit 3 | Mifare DESFire |
Bit 4 | Mifare UltraLight |
Bit 5 | JCOP30 |
Bit 6 | Shanghai Transport |
Bit 7 | MPCOS Combi |
Bit 8 | ISO Type B, Calypso |
Bit 9 - Bit 31 | To be defined |
public byte getCardOpMode()
public byte getFWI()
public short open(short hReaderPort)
hReaderPort
- a 0-based instance number of the ACR120U that is connected to USB port.
public short close(short hReader)
hReader
- the USB handle returned by a prior call to open() method.
public short reset(short hReader)
hReader
- the USB handle returned by a prior call to open() method.
public short status(short hReader)
hReader
- the USB handle returned by a prior call to open() method.
public short readRC531Reg(short hReader, byte RegNo, byte[] Value)
hReader
- the USB handle returned by a prior call to open() method.RegNo
- the register number.Value
- the retrieved value of Mifare register. It is an array of 1 element.
public short writeRC531Reg(short hReader, byte RegNo, byte Value)
hReader
- the USB handle returned by a prior call to open() method.RegNo
- the register number.Value
- the value of Mifare register to write.
public short directSend(short hReader, byte DataLength, byte[] pData, byte[] pResponseDataLength, byte[] pResponseData, short TimedOut)
hReader
- the USB handle returned by a prior call to open() method.DataLength
- the length of data to send (maximum 66 bytes).pData
- the data to send.pResponseDataLength
- the length of response data. It is an array of 1 element.pResponseData
- the received data.TimedOut
- The time out constant to wait for the response data (in m-sec).
public short directReceive(short hReader, byte RespectedDataLength, byte[] pReceivedDataLength, byte[] pReceivedData, short TimedOut)
hReader
- the USB handle returned by a prior call to open() method.RespectedDataLength
- the expected length of data to receive (maximum 64 bytes).pReceivedDataLength
- the length of data actually received. It is an array of 1 element.pReceivedData
- the received data.TimedOut
- The time out constant to wait for the response data (in m-sec).
public short requestDLLVersion(byte[] pVersionInfoLength, byte[] pVersionInfo)
pVersionInfoLength
- the length of the returned native method DLL version string. It is an array of 1 element.pVersionInfo
- native method DLL version string.
public short readEEPROM(short hReader, byte RegNo, byte[] pEEPROMData)
hReader
- the USB handle returned by a prior call to open() method.RegNo
- the register number.pEEPROMData
- the received value of EEPROM register. It is an array of 1 element.
public short writeEEPROM(short hReader, byte RegNo, byte EEPROMData)
hReader
- the USB handle returned by a prior call to open() method.RegNo
- the register number.EEPROMData
- the value of EEPROM register to write.
public short readUserPort(short hReader, byte[] pUserPortState)
hReader
- the USB handle returned by a prior call to open() method.pUserPortState
- the received port state. It is an array of 1 element.
Meaning of this value is interpreted in bit level:
Bit 0 | Not used |
Bit 1 | Buzzer (0=OFF; 1=ON) |
Bit 2 | Not used |
Bit 3 | Not used |
Bit 4 | Not used |
Bit 5 | Not used |
Bit 6 | LED (0=OFF; 1=ON) |
Bit 7 | Not used |
public short writeUserPort(short hReader, byte UserPortState)
hReader
- the USB handle returned by a prior call to open() method.UserPortState
- the port state to write.
public short select(short hReader, byte[] pResultTagType, byte[] pResultTagLength, byte[] pResultSN)
hReader
- the USB handle returned by a prior call to open() method.pResultTagType
- the type of the selected Tag. It is an array of 1 element.pResultTagLength
- the length of the selected Tag. It is an array of 1 element.pResultSN
- the ID (Serial Number) of the selected card. The ID may be 4, 7 or 10 bytes long.
public short power(short hReader, byte State)
hReader
- the USB handle returned by a prior call to open() method.State
- the state of the antenna power, 0 = OFF; 1 = ON.
public short login(short hReader, byte Sector, byte KeyType, byte StoredNo, byte[] pKey)
hReader
- the USB handle returned by a prior call to open() method.Sector
- the sector number to login.KeyType
- the type of key.StoredNo
- the stored number of key if key type = AC_MIFARE_LOGIN_KEYTYPE_STORED_A or AC_MIFARE_LOGIN_KEYTYPE_STORED_B.pKey
- the login key if KeyType = AC_MIFARE_LOGIN_KEYTYPE_A or AC_MIFARE_LOGIN_KEYTYPE_B. It is an array of ACR120UJNI_MIFARE_KEY_LENGTH (6) elements.
public short listTags(short hReader, byte[] pNumTagFound, byte[] pTagType, byte[] pTagLength, byte[][] pSN)
hReader
- the USB handle returned by a prior call to open() method.pNumTagFound
- the number of tags listed. It is an array of 1 element.pTagType
- the type of tag. It is an array of ACR120UJNI_MAX_NUM_TAGS (4) elements.pTagLength
- the length of the serial number. It is an array of ACR120UJNI_MAX_NUM_TAGS (4) elements.pSN
- the serial numbers of the cards. It is a 2D array of the size, pSN[4][10].
public short read(short hReader, byte Block, byte[] pBlockData)
hReader
- the USB handle returned by a prior call to open() method.Block
- the block number to read.pBlockData
- the data that was read. It is an array of ACR120UJNI_MIFARE_BLOCK_LENGTH (16) elements.
public short readValue(short hReader, byte Block, int[] pValueData)
hReader
- the USB handle returned by a prior call to open() method.Block
- the block number to read.pValueData
- the value to read. It is an array of 1 element.
public short write(short hReader, byte Block, byte[] pBlockData)
hReader
- the USB handle returned by a prior call to open() method.Block
- the block number to write.pBlockData
- the data to write. It is an array of ACR120UJNI_MIFARE_BLOCK_LENGTH (16) elements.
public short writeValue(short hReader, byte Block, int ValueData)
hReader
- the USB handle returned by a prior call to open() method.Block
- the block number to write.ValueData
- the value to write.
public short writeMasterKey(short hReader, byte KeyNo, byte[] pKey)
hReader
- the USB handle returned by a prior call to open() method.KeyNo
- the master key number.pKey
- the key to write. It is an array of ACR120UJNI_MIFARE_KEY_LENGTH (6).
public short inc(short hReader, byte Block, int Value, int[] pNewValue)
hReader
- the USB handle returned by a prior call to open() method.Block
- the block number.Value
- the value added to the block value.pNewValue
- the updated value after increment. It is an array of 1 element.
public short dec(short hReader, byte Block, int Value, int[] pNewValue)
hReader
- the USB handle returned by a prior call to open() method.Block
- the block number.Value
- the value subtracted from the block value.pNewValue
- the updated value after decrement. It is an array of 1 element.
public short copy(short hReader, byte srcBlock, byte desBlock, int[] pNewValue)
hReader
- the USB handle returned by a prior call to open() method.srcBlock
- the source block number.desBlock
- the destination block number.pNewValue
- the updated value of desBlock after copy. It is an array of 1 element.
public short multiTagSelect(short hReader, byte TagLength, byte[] SN, byte[] pResultTagType, byte[] pResultTagLength, byte[] pResultSN)
hReader
- the USB handle returned by a prior call to open() method.TagLength
- the length of the serial number of the Tag to be selected. The length may be 4, 7 or 10.SN
- the serial number of the Tag to be selected. It is a short array of ACR120UJNI_MAX_TAG_LENGTH (10) elements.pResultTagType
- the type of selected Tag. It is an array of 1 element.pResultTagLength
- the length of the serial number of the selected Tag. The length may be 4, 7 or 10.pResultSN
- the serial number of the selected TAG.
public short txDataTelegram(short hReader, byte SendDataLength, byte[] pSendData, byte[] pReceivedDataLength, byte[] pReceivedData)
hReader
- the USB handle returned by a prior call to open() method.SendDataLength
- the length of the data to send.pSendData
- the data to send.pReceivedDataLength
- the length of the received data. It is an array of 1 element.pReceivedData
- the data received from card.
public short initBlockNumber(short FrameLength)
FrameLength
- an index to a maximum frame size which the card can accept.
public short xchAPDU(short hReader, boolean typeA, short[] xLen, byte[] xData, short[] rLen, byte[] rData)
hReader
- the USB handle returned by a prior call to open() method.typeA
- a value indicating the card type, TRUE for type A cards, FALSE for type B cards.xLen
- a pointer to the location storing the length of the data to transmit, in bytes.xData
- a pointer to the transmit data storage.rLen
- a pointer to the location storing the length of the data received, in bytes.rData
- a pointer to the receive data storage.
public short rATS(short hReader, byte FSDI, byte[] atslen, byte[] ats)
hReader
- the USB handle returned by a prior call to open() method.FSDI
- an index to a maximum frame size which the reader can accept. The value should not exceed 4, i.e. 48 bytes.atslen
- a pointer to the location storing the length of the ATS received.ats
- a pointer to the ATS received.
public short deselect(short hReader, boolean typeA)
hReader
- the USB handle returned by a prior call to open() method.typeA
- a Boolean value indicates the card type, TRUE for type A cards, FALSE for type B cards.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |