|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectacs.jni.ACR120S
public class ACR120S
ACR120S JNI Class Package provides the programming interfaces for developer to develop application for ACR120S 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_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_COM_BAUDRATE_115200
This constant field defines the COM baudrate of ACR120S used to communicate with PC. |
static short |
ACR120_COM_BAUDRATE_19200
This constant field defines the COM baudrate of ACR120S used to communicate with PC. |
static short |
ACR120_COM_BAUDRATE_38400
This constant field defines the COM baudrate of ACR120S used to communicate with PC. |
static short |
ACR120_COM_BAUDRATE_57600
This constant field defines the COM baudrate of ACR120S used to communicate with PC. |
static short |
ACR120_COM_BAUDRATE_9600
This constant field defines the COM baudrate of ACR120S used to communicate with PC. |
static short |
ACR120_COM1
This constant field defines the instance of ACR120S connected to the COM port. |
static short |
ACR120_COM2
This constant field defines the instance of ACR120S connected to the COM port. |
static short |
ACR120_COM3
This constant field defines the instance of ACR120S connected to the COM port. |
static short |
ACR120_COM4
This constant field defines the instance of ACR120S connected to the COM port. |
static short |
ACR120_COM5
This constant field defines the instance of ACR120S connected to the COM port. |
static short |
ACR120_COM6
This constant field defines the instance of ACR120S connected to the COM port. |
static short |
ACR120_COM7
This constant field defines the instance of ACR120S connected to the COM port. |
static short |
ACR120_COM8
This constant field defines the instance of ACR120S connected to the COM 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 |
ACR120SJNI_14443_BUFFER_SIZE
This constant field defines the default buffer size used with ISO-14443 card. |
static int |
ACR120SJNI_DEFAULT_BUFFER_SIZE
This constant field defines the default buffer size used with Mifare card. |
static int |
ACR120SJNI_MAX_NUM_TAGS
This constant field defines the maximum number of tags that can be listed using listTags method. |
static int |
ACR120SJNI_MAX_TAG_LENGTH
This constant field defines the maximum tag length returned by a card. |
static int |
ACR120SJNI_MIFARE_BLOCK_LENGTH
This constant field defines the block length of Mifare card. |
static int |
ACR120SJNI_MIFARE_KEY_LENGTH
This constant field defines the maximum key length of Mifare card. |
static short |
TAG_ISO_TYPEB
This constant field defines the type of the contactless card. |
static short |
TAG_JCOP30
This constant field defines the type of the contactless card. |
static short |
TAG_MIFARE_1K
This constant field defines the type of the contactless card. |
static short |
TAG_MIFARE_4K
This constant field defines the type of the contactless card. |
static short |
TAG_MIFARE_DESFIRE
This constant field defines the type of the contactless card. |
static short |
TAG_MIFARE_LIGHT
This constant field defines the type of the contactless card. |
static short |
TAG_MIFARE_ULTRALIGHT
This constant field defines the type of the contactless card. |
static short |
TAG_MPCOS_COMBI
This constant field defines the type of the contactless card. |
static short |
TAG_SHANGHAI_TRANSPORT
This constant field defines the type of the contactless card. |
Constructor Summary | |
---|---|
ACR120S()
|
Method Summary | |
---|---|
short |
close(short hReader)
Closes the connection to reader. |
short |
copy(short hReader,
byte stationID,
byte srcBlock,
byte desBlock,
int[] pNewValue)
Copies a value block to another value block of the same sector. |
short |
dec(short hReader,
byte stationID,
byte Block,
int Value,
int[] pNewValue)
Decrements a value of block by subtracting a value. |
short |
deselect(short hReader,
byte stationID,
boolean typeA)
Requests an Answer-to-Select (ATS) message from the card after calling the Select method. |
short |
getID(short hReader,
byte[] pNumID,
byte[] pStationID)
Gets the station ID's for all reader modules on the RS485 bus. |
short |
inc(short hReader,
byte stationID,
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 stationID,
byte[] pNumTagFound,
boolean[] pHaveTag,
byte[] pTAG,
byte[] pSN)
Lists out the serial numbers of all tags, which are in the readable antenna range. |
short |
login(short hReader,
byte stationID,
byte Sector,
byte KeyType,
byte StoredNo,
byte[] pKey)
Performs an authentication to access one sector of the card. |
short |
multiTagSelect(short hReader,
byte stationID,
byte[] SN,
boolean[] pHaveTag,
byte[] pTAG,
byte[] pResultSN)
Selects a TAG with specific serial number. |
short |
open(short hReaderPort,
short Baudrate)
Opens the connection to reader. |
short |
power(short hReader,
byte stationID,
boolean State)
turn on or off the antenna power. |
short |
rATS(short hReader,
byte stationID,
byte FSDI,
boolean typeA,
byte[] atslen,
byte[] ats)
Requests an Answer-to-Select (ATS) message from the card after calling the Select method. |
short |
read(short hReader,
byte stationID,
byte Block,
byte[] pBlockData)
Reads a block. |
short |
readEEPROM(short hReader,
byte stationID,
byte RegNo,
byte[] pEEPROMData)
Reads the internal EEPROM of the reader. |
short |
readRC531Reg(short hReader,
byte stationID,
byte RegNo,
byte[] Value)
Reads the Mifare register. |
short |
readUserPort(short hReader,
byte stationID,
byte[] pUserPortState)
Reads the state of user port. |
short |
readValue(short hReader,
byte stationID,
byte Block,
int[] pValueData)
Reads a value. |
short |
requestDLLVersion(byte[] pVersionInfoLength,
byte[] pVersionInfo)
Gets the native method DLL version information. |
short |
requestVersionInfo(short hReader,
byte stationID,
byte[] pVersionInfoLen,
byte[] pVersionInfo)
Gets the reader's firmware version information. |
short |
reset(short hReader,
byte stationID)
Resets the Mifare chip of the reader and restore factory setting. |
short |
select(short hReader,
byte stationID,
boolean[] pHaveTag,
byte[] pTAG,
byte[] pSN)
Selects a single card and returns the card ID (Serial Number). |
short |
txDataTelegram(short hReader,
byte stationID,
byte SendDataLength,
boolean bParity,
boolean bOddParity,
boolean bCRCGen,
boolean bCRCCheck,
boolean bCryptoInactive,
byte bitFrame,
byte[] pSendData,
byte[] pReceivedDataLength,
byte[] pReceivedData)
Sends data to the selected card. |
short |
write(short hReader,
byte stationID,
byte Block,
byte[] pBlockData)
Writes a block. |
short |
writeEEPROM(short hReader,
byte stationID,
byte RegNo,
byte EEPROMData)
Writes the internal EEPROM of the reader. |
short |
writeMasterKey(short hReader,
byte stationID,
byte KeyNo,
byte[] pKey)
Writes master keys. |
short |
writeRC531Reg(short hReader,
byte stationID,
byte RegNo,
byte Value)
Writes the Mifare register. |
short |
writeUserPort(short hReader,
byte stationID,
byte UserPortState)
Writes the state of user port. |
short |
writeValue(short hReader,
byte stationID,
byte Block,
int ValueData)
Writes a value. |
short |
xchAPDU(short hReader,
byte stationID,
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_COM1
public static final short ACR120_COM2
public static final short ACR120_COM3
public static final short ACR120_COM4
public static final short ACR120_COM5
public static final short ACR120_COM6
public static final short ACR120_COM7
public static final short ACR120_COM8
public static final short ACR120_COM_BAUDRATE_9600
public static final short ACR120_COM_BAUDRATE_19200
public static final short ACR120_COM_BAUDRATE_38400
public static final short ACR120_COM_BAUDRATE_57600
public static final short ACR120_COM_BAUDRATE_115200
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_F
public static final short AC_MIFARE_LOGIN_KEYTYPE_STORED_A
public static final short AC_MIFARE_LOGIN_KEYTYPE_STORED_B
public static final short TAG_MIFARE_LIGHT
public static final short TAG_MIFARE_1K
public static final short TAG_MIFARE_4K
public static final short TAG_MIFARE_DESFIRE
public static final short TAG_MIFARE_ULTRALIGHT
public static final short TAG_JCOP30
public static final short TAG_SHANGHAI_TRANSPORT
public static final short TAG_MPCOS_COMBI
public static final short TAG_ISO_TYPEB
public static final int ACR120SJNI_DEFAULT_BUFFER_SIZE
public static final int ACR120SJNI_14443_BUFFER_SIZE
public static final int ACR120SJNI_MAX_NUM_TAGS
public static final int ACR120SJNI_MAX_TAG_LENGTH
public static final int ACR120SJNI_MIFARE_KEY_LENGTH
public static final int ACR120SJNI_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 ACR120S()
Method Detail |
---|
public short open(short hReaderPort, short Baudrate)
hReaderPort
- a 0-based instance number of the ACR120S that is connected to COM port.Baudrate
- a 0-based index to set the communication speed between PC COM port and ACR120S.
Possible values:
ACR120_COM_BAUDRATE_9600 | 9600 bps |
ACR120_COM_BAUDRATE_19200 | 19200 bps |
ACR120_COM_BAUDRATE_38400 | 38400 bps |
ACR120_COM_BAUDRATE_57600 | 57600 bps |
ACR120_COM_BAUDRATE_115200 | 115200 bps |
public short close(short hReader)
hReader
- the COM handle returned by a prior call to open() method.
public short reset(short hReader, byte stationID)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.
public short readRC531Reg(short hReader, byte stationID, byte RegNo, byte[] Value)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.RegNo
- the register number.Value
- the retrieved value of Mifare register. It is an array of 1 element.
public short writeRC531Reg(short hReader, byte stationID, byte RegNo, byte Value)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.RegNo
- the register number.Value
- the value of Mifare register to write.
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 stationID, byte RegNo, byte[] pEEPROMData)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.RegNo
- the register number.pEEPROMData
- the received value of EEPROM register. It is an array of 1 element.
public short writeEEPROM(short hReader, byte stationID, byte RegNo, byte EEPROMData)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.RegNo
- the register number.EEPROMData
- the value of EEPROM register to write.
public short readUserPort(short hReader, byte stationID, byte[] pUserPortState)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.pUserPortState
- the received port state. It is an array of 1 element.
Possible values:
0x00 | Relay/LED and Buzzer OFF |
0x01 | Relay/LED ON, Buzzer OFF |
0x02 | Relay/LED OFF, Buzzer ON |
0x03 | Relay/LED and Buzzer ON |
public short writeUserPort(short hReader, byte stationID, byte UserPortState)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.UserPortState
- the port state to write.
public short select(short hReader, byte stationID, boolean[] pHaveTag, byte[] pTAG, byte[] pSN)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.pHaveTag
- the output variable that indicates whether TAG type identification is returned: (TRUE) or (FALSE).pTAG
- the list of TAG type identification. If pHaveTag is FALSE, this is an array of serial number length of the cards detected. If pHaveTag is TRUE, this is an array of TAG type. The corresponding serial number length could then be determined from the TAG type.pSN
- the ID (Serial Number) of the selected card. The ID may be 4, 7 or 10 bytes long.
public short power(short hReader, byte stationID, boolean State)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.State
- the state of the antenna power, 0 = OFF; 1 = ON.
public short login(short hReader, byte stationID, byte Sector, byte KeyType, byte StoredNo, byte[] pKey)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.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 ACR120SJNI_MIFARE_KEY_LENGTH (6) elements.
public short listTags(short hReader, byte stationID, byte[] pNumTagFound, boolean[] pHaveTag, byte[] pTAG, byte[] pSN)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.pNumTagFound
- the number of tags listed. It is an array of 1 element.pHaveTag
- the output variable that indicates whether TAG type identification is returned: (TRUE) or (FALSE).pTAG
- the list of TAG type identification. If pHaveTag is FALSE, this is an array of serial number length of the cards detected. If pHaveTag is TRUE, this is an array of TAG type. The corresponding serial number length could then be determined from the TAG type.pSN
- the serial numbers of the cards. The ID may be 4, 7 or 10 bytes long.
public short read(short hReader, byte stationID, byte Block, byte[] pBlockData)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.Block
- the block number to read.pBlockData
- the data that was read. It is an array of ACR120SJNI_MIFARE_BLOCK_LENGTH (16) elements.
public short readValue(short hReader, byte stationID, byte Block, int[] pValueData)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.Block
- the block number to read.pValueData
- the value to read. It is an array of 1 element.
public short write(short hReader, byte stationID, byte Block, byte[] pBlockData)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.Block
- the block number to write.pBlockData
- the data to write. It is an array of ACR120SJNI_MIFARE_BLOCK_LENGTH (16) elements.
public short writeValue(short hReader, byte stationID, byte Block, int ValueData)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.Block
- the block number to write.ValueData
- the value to write.
public short writeMasterKey(short hReader, byte stationID, byte KeyNo, byte[] pKey)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.KeyNo
- the master key number.pKey
- the key to write. It is an array of ACR120SJNI_MIFARE_KEY_LENGTH (6).
public short inc(short hReader, byte stationID, byte Block, int Value, int[] pNewValue)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.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 stationID, byte Block, int Value, int[] pNewValue)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.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 stationID, byte srcBlock, byte desBlock, int[] pNewValue)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.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 getID(short hReader, byte[] pNumID, byte[] pStationID)
hReader
- the COM handle returned by a prior call to open() method.pNumID
- the number of station ID retured.pStationID
- the list of station ID returned.
public short multiTagSelect(short hReader, byte stationID, byte[] SN, boolean[] pHaveTag, byte[] pTAG, byte[] pResultSN)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.SN
- the serial number of the Tag to be selected. It is a short array of ACR120SJNI_MAX_TAG_LENGTH (10) elements.pHaveTag
- the output variable that indicates whether TAG type identification is returned: (TRUE) or (FALSE).pTAG
- the TAG type identification of selected TAG.pResultSN
- the serial number of the selected TAG.
public short txDataTelegram(short hReader, byte stationID, byte SendDataLength, boolean bParity, boolean bOddParity, boolean bCRCGen, boolean bCRCCheck, boolean bCryptoInactive, byte bitFrame, byte[] pSendData, byte[] pReceivedDataLength, byte[] pReceivedData)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.SendDataLength
- the length of the data to send.bParity
- TRUE if parity generation is enabled.bOddParity
- TRUE if parity is odd. Otherwise, it's even.bCRCGen
- TRUE if CRC generation for transmission is enabled.bCRCCheck
- TRUE if CRC checking for receiving is enabled.bCryptoInactive
- TRUE if Crypto unit is deactivated before transmission start.bitFrame
- bit framing (number of bits from last byte transmitted).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 requestVersionInfo(short hReader, byte stationID, byte[] pVersionInfoLen, byte[] pVersionInfo)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.pVersionInfoLen
- the length of the ACR120 firmware version string.pVersionInfo
- the ACR120 firmware version string.
public short initBlockNumber(short FrameLength)
FrameLength
- an index to a maximum frame size which the card can accept.
public short xchAPDU(short hReader, byte stationID, boolean typeA, short[] xLen, byte[] xData, short[] rLen, byte[] rData)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.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 stationID, byte FSDI, boolean typeA, byte[] atslen, byte[] ats)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.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, byte stationID, boolean typeA)
hReader
- the COM handle returned by a prior call to open() method.stationID
- the StationID of ACR120 reader.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 |