public class Function
extends java.lang.Object
構造器和說明 |
---|
Function() |
限定符和類型 | 方法和說明 |
---|---|
static int |
AntiType_B(int commHandle,
int DeviceAddress,
byte[] buffer)
ISO14443B命令:該命令執行ISO14443B中的AnticollB命令.
|
static int |
API_CloseComm(int commHandle)
系統命令:關閉已經打開的串口。
|
static int |
API_ControlBuzzer(int commHandle,
int DeviceAddress,
byte freq,
byte duration,
byte[] buffer)
系統命令:設置蜂鳴器的工作狀態,包括,蜂鳴器的工作週期以及循環的次數。
|
static int |
API_ControlLED(int commHandle,
int DeviceAddress,
byte freq,
byte duration,
byte[] buffer)
系統命令:設置燈的工作狀態,包括,燈亮的週期以及循環的次數。
|
static int |
API_GetSerNum(int commHandle,
int DeviceAddress,
byte[] buffer)
系統命令:讀取由廠家預設的1個字節的讀卡器地址和8個字節序列號。
|
static int |
API_ISO14443TypeBTransCOSCmd(int commHandle,
int DeviceAddress,
byte[] cmd,
int cmdSize,
byte[] buffer)
ISO14443B命令:ISO14443傳送命令,可以通過此命令向卡發任意有效的命令,數據.
|
static int |
API_ISO15693_GetMulSecurity(int commHandle,
int DeviceAddress,
byte flags,
byte blkAddr,
byte blkNum,
byte[] uid,
byte[] pBuffer)
ISO15693命令:用於獲取卡的各個塊的安全狀態位的數據
|
static int |
API_ISO15693_GetSysInfo(int commHandle,
int DeviceAddress,
byte flags,
byte[] uid,
byte[] buffer)
ISO15693命令:用於得到卡的詳細信息,具體內容請參考,ISO15693協議資料。
|
static int |
API_ISO15693_Inventory(int commHandle,
int DeviceAddress,
byte flag,
byte afi,
byte[] pData,
byte[] nrOfCard,
byte[] pBuffer)
ISO15693命令:此命令通過防衝突用於得到讀卡區域內所有卡片的序列號(能得到的卡片數量與模塊天線的輸出功率有關,一般能對2~6卡進行防衝突).
|
static int |
API_ISO15693Lock(int commHandle,
int DeviceAddress,
byte flags,
byte num_blk,
byte[] uid,
byte[] buffer)
ISO15693命令:用於鎖定塊內容。
|
static int |
API_ISO15693Read(int commHandle,
int DeviceAddress,
byte flags,
byte blk_add,
byte num_blk,
byte[] uid,
byte[] buffer)
ISO15693命令:用來讀取1個或多個扇區的值,如果要讀每個塊的安全位,將FLAGS中Option_flag置為1,即FLAG = 0X42,每個扇區將返回5個字節,包括1個表示安全狀態字節和4個字節的塊內容,這時候每次最多能讀12個塊。
|
static int |
API_ISO15693Select(int commHandle,
int DeviceAddress,
byte flags,
byte[] uid,
byte[] buffer)
ISO15693命令:此命令必須用地址模式,如果發送的數據與被操作的卡的序列號相同,操作成功後,卡將進入被選擇狀態,否則狀態不變。
|
static int |
API_ISO15693StayQuiet(int commHandle,
int DeviceAddress,
byte flags,
byte[] uid,
byte[] buffer)
ISO15693命令:此命令用於將卡置於靜止的狀態, 必須用地址模式,如果發送的數據與被操作的卡的序列號相同,操作成功後,卡將進入靜止狀態,否則狀態不變。
|
static int |
API_ISO15693TransCOSCmd(int commHandle,
int DeviceAddress,
byte[] cmd,
int cmdSize,
byte[] buffer)
ISO15693命令:一個通用命令,用戶可以通過此命令,對卡進行各種操作。
|
static int |
API_ISO15693Write(int commHandle,
int DeviceAddress,
byte flags,
byte blk_add,
byte num_blk,
byte[] uid,
byte[] data)
ISO15693命令:對一個塊進行寫操作(每次只能寫一個塊)。
|
static int |
API_LockAFI(int commHandle,
int DeviceAddress,
byte flags,
byte[] uid,
byte[] buffer)
ISO15693命令:用於鎖定卡的AFI,鎖定後AFI不可以更改。
|
static int |
API_LockDSFID(int commHandle,
int DeviceAddress,
byte flags,
byte[] uid,
byte[] buffer)
ISO15693命令:用於鎖定卡的DSFID,鎖定後DSFID不可以更改.
|
static int |
API_OpenComm(byte[] com,
int Baudrate)
系統命令:打開串口。
|
static int |
API_PCDDec(int commHandle,
int DeviceAddress,
byte mode,
byte SectNum,
byte[] snr,
byte[] value)
ISO14443A命令:對卡的指定扇區進行減值操作。
|
static int |
API_PCDInc(int commHandle,
int DeviceAddress,
byte mode,
byte SectNum,
byte[] snr,
byte[] value)
ISO14443A命令:對卡的指定扇區進行加值操作。
|
static int |
API_PCDInitVal(int commHandle,
int DeviceAddress,
byte mode,
byte SectNum,
byte[] snr,
byte[] value)
ISO14443A命令:初始化卡.
|
static int |
API_PCDRead(int commHandle,
int DeviceAddress,
byte mode,
byte blk_add,
byte num_blk,
byte[] snr,
byte[] buffer)
ISO14443A命令:在指定位置讀取指定長度的數據.
|
static int |
API_PCDWrite(int commHandle,
int DeviceAddress,
byte mode,
byte blk_add,
byte num_blk,
byte[] snr,
byte[] buffer)
ISO14443A命令:在指定位置寫入數據.
|
static int |
API_ResetToReady(int commHandle,
int DeviceAddress,
byte flags,
byte[] uid,
byte[] buffer)
ISO15693命令:操作成功後,卡回到Ready狀態。
|
static int |
API_SetBandrate(int commHandle,
int DeviceAddress,
byte newBaud,
byte[] buffer)
系統命令:設置讀寫器通訊的波特率。
|
static int |
API_SetDeviceAddress(int commHandle,
int DeviceAddress,
byte newAddr,
byte[] buffer)
系統命令:設置讀卡器的地址.
|
static int |
API_SetSerNum(int commHandle,
int DeviceAddress,
byte[] newValue,
byte[] buffer)
系統命令:設置 8個字節的產品序列號。
|
static int |
API_WriteAFI(int commHandle,
int DeviceAddress,
byte flags,
byte afi,
byte[] uid,
byte[] buffer)
ISO15693命令:對卡進行寫AFI操作。
|
static int |
API_WriteDSFID(int commHandle,
int DeviceAddress,
byte flags,
byte DSFID,
byte[] uid,
byte[] buffer)
ISO15693命令:對卡的進行寫DSFID操作.
|
static int |
GET_SNR(int commHandle,
int DeviceAddress,
byte mode,
byte API_halt,
byte[] snr,
byte[] value)
ISO14443A命令:返回1個字節的單卡或多卡標識,4個字節的卡號。
|
static int |
GetVersionNum(int commHandle,
int DeviceAddress,
byte[] VersionNum)
系統命令:讀取讀寫器的版本號.
|
static int |
MF_Anticoll(int commHandle,
int DeviceAddress,
byte[] snr,
byte[] status)
ISO14443A命令:檢測卡片數量,單卡或多卡,並返回4個字節的卡號。
|
static int |
MF_Halt(int commHandle,
int DeviceAddress)
ISO14443A命令:選擇卡,使卡進入被中斷的狀態.
|
static int |
MF_Request(int commHandle,
int DeviceAddress,
byte inf_mode,
byte[] buffer)
ISO14443A命令:發送ISO14443 A 尋卡指令。
|
static int |
MF_Restore(int commHandle,
int DeviceAddress,
byte mode,
int cardlength,
byte[] carddata)
ISO14443A命令:按照選擇的模式,進行數據的發送.
|
static int |
MF_Select(int commHandle,
int DeviceAddress,
byte[] snr)
ISO14443A命令:使卡進入被選擇的狀態.
|
static int |
ReadUserInfo(int commHandle,
int DeviceAddress,
int num_blk,
int num_length,
byte[] user_info)
系統命令:讀取讀卡器中提供4個塊(每個塊不能大於120個字節)的數據。
|
static int |
Request_AB(int commHandle,
int DeviceAddress,
byte[] buffer)
ISO14443B命令:該命令執行幾集成了ISO14443B中的,REQUEST和ATTRIB命令,通過一個命令使卡復位。
|
static int |
RequestType_B(int commHandle,
int DeviceAddress,
byte[] buffer)
ISO14443B命令:該命令執行ISO14443B中的REQB命令,獲取卡片的PUPI代碼。
|
static int |
SelectType_B(int commHandle,
int DeviceAddress,
byte[] SerialNum)
ISO14443B命令:該命令執行ISO14443B中的ATTRIB命令,給已知PUPI的卡片分配一個識別號CID.
|
static int |
UL_HLRead(int commHandle,
int DeviceAddress,
byte mode,
byte blk_add,
byte[] snr,
byte[] buffer)
Ultralight命令:發送Ultralight讀卡命令
|
static int |
UL_HLWrite(int commHandle,
int DeviceAddress,
byte mode,
byte blk_add,
byte[] snr,
byte[] buffer)
Ultralight命令:發送Ultralight寫卡命令。
|
static int |
UL_Request(int commHandle,
int DeviceAddress,
byte mode,
byte[] snr)
Ultralight命令:發送Ultralight尋卡指令。
|
static int |
WriteUserInfo(int commHandle,
int DeviceAddress,
int num_blk,
int num_length,
byte[] user_info)
系統命令:讀卡器提供4個塊(每個塊不能大於120個字節),共480個字節空間的用戶數據區。
|
public static int API_OpenComm(byte[] com, int Baudrate)
com
- 連接讀寫器的串口名。Baudrate
- 串口的通訊波特率(可選 : 9600, 19200, 38400, 57600, 115200)。public static int API_CloseComm(int commHandle)
commHandle
- 待關閉的串口句柄。public static int API_SetDeviceAddress(int commHandle, int DeviceAddress, byte newAddr, byte[] buffer)
commHandle
- 操作的串口.DeviceAddress
- 設備地址.newAddr
- 需要設置的新的地址.buffer
- 用來返回接收到的數據 .public static int API_SetBandrate(int commHandle, int DeviceAddress, byte newBaud, byte[] buffer)
commHandle
- 操作的串口.DeviceAddress
- 設備地址.newBaud
- 需要設置的新的波特率(可選 : 9600, 19200, 38400, 57600, 115200).buffer
- 用來返回接收到的數據.public static int API_SetSerNum(int commHandle, int DeviceAddress, byte[] newValue, byte[] buffer)
commHandle
- 操作的串口.DeviceAddress
- 設備地址.newValue
- 8個字節的讀寫器序列號.buffer
- 用來返回接收到的數據.public static int API_GetSerNum(int commHandle, int DeviceAddress, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。buffer
- 用來返回接收到的數據。public static int WriteUserInfo(int commHandle, int DeviceAddress, int num_blk, int num_length, byte[] user_info)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。num_blk
- 區域號。num_length
- 數據長度。user_info
- 用戶數據。public static int ReadUserInfo(int commHandle, int DeviceAddress, int num_blk, int num_length, byte[] user_info)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。num_blk
- 區域號。num_length
- 讀取的數據長度。user_info
- 待讀入的用戶數據 。public static int GetVersionNum(int commHandle, int DeviceAddress, byte[] VersionNum)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。VersionNum
- 待讀入的版本號。public static int API_ControlLED(int commHandle, int DeviceAddress, byte freq, byte duration, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。freq
- 週期數。duration
- 次數。buffer
- 待返回的參數。public static int API_ControlBuzzer(int commHandle, int DeviceAddress, byte freq, byte duration, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。freq
- 週期數。duration
- 次數。buffer
- 待返回的參數。public static int MF_Request(int commHandle, int DeviceAddress, byte inf_mode, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。inf_mode
- 尋卡模式。buffer
- public static int MF_Anticoll(int commHandle, int DeviceAddress, byte[] snr, byte[] status)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。snr
- 返回4個字節的卡號。status
- 返回卡片的數量。public static int MF_Select(int commHandle, int DeviceAddress, byte[] snr)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。snr
- 傳入4個字節卡號,並且返回4個字節的卡號.public static int MF_Halt(int commHandle, int DeviceAddress)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。public static int API_PCDRead(int commHandle, int DeviceAddress, byte mode, byte blk_add, byte num_blk, byte[] snr, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。mode
- 讀取模式blk_add
- 讀取塊地址.num_blk
- 讀取塊數目.snr
- 六個字節的密鑰.buffer
- 等待接受輸出變量.public static int API_PCDWrite(int commHandle, int DeviceAddress, byte mode, byte blk_add, byte num_blk, byte[] snr, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。mode
- 讀取模式blk_add
- 要寫塊地址.num_blk
- 要寫塊數目.snr
- 6字節密碼.buffer
- 待寫入的數據.public static int API_PCDInitVal(int commHandle, int DeviceAddress, byte mode, byte SectNum, byte[] snr, byte[] value)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。mode
- 讀取模式SectNum
- 要初始化的扇區號00-0F.snr
- 6字節密鑰.value
- 4 字節的要初始化的數據.public static int API_PCDDec(int commHandle, int DeviceAddress, byte mode, byte SectNum, byte[] snr, byte[] value)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。mode
- 讀取模式SectNum
- 要寫值的扇區號00-0F.snr
- 6字節密鑰.value
- 要減的值,4個字節長度.public static int API_PCDInc(int commHandle, int DeviceAddress, byte mode, byte SectNum, byte[] snr, byte[] value)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。mode
- 讀取模式SectNum
- 要加值的扇區號00-0F.snr
- 6字節密鑰.value
- 要加的值,4個字節長度.public static int GET_SNR(int commHandle, int DeviceAddress, byte mode, byte API_halt, byte[] snr, byte[] value)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。mode
- 模式控制.API_halt
- snr
- value
- public static int MF_Restore(int commHandle, int DeviceAddress, byte mode, int cardlength, byte[] carddata)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。mode
- 模式控制.cardlength
- carddata
- public static int RequestType_B(int commHandle, int DeviceAddress, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。buffer
- 卡片復位後的數據串 (ATQB)。public static int AntiType_B(int commHandle, int DeviceAddress, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。buffer
- 卡片返回的數據串(ATQB).public static int SelectType_B(int commHandle, int DeviceAddress, byte[] SerialNum)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。SerialNum
- 卡的序列號.public static int Request_AB(int commHandle, int DeviceAddress, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。buffer
- 返回操作後的卡的序列號4個字節.public static int API_ISO14443TypeBTransCOSCmd(int commHandle, int DeviceAddress, byte[] cmd, int cmdSize, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。cmd
- 待發送的數據.cmdSize
- 數據長度.buffer
- 回收的數據.public static int API_ISO15693_Inventory(int commHandle, int DeviceAddress, byte flag, byte afi, byte[] pData, byte[] nrOfCard, byte[] pBuffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。flag
- 標識字節1個字節.afi
- AFI就是數據長度.pData
- 發送的數據.nrOfCard
- 返回的卡的數量.pBuffer
- 返回的數據(包括FLAG和DSFID和8[]n個字節的卡號).public static int API_ISO15693Read(int commHandle, int DeviceAddress, byte flags, byte blk_add, byte num_blk, byte[] uid, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。flags
- 標誌位。blk_add
- 要讀的起始塊號。num_blk
- 塊的數量。uid
- UID信息。buffer
- 返回值。public static int API_ISO15693Write(int commHandle, int DeviceAddress, byte flags, byte blk_add, byte num_blk, byte[] uid, byte[] data)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。flags
- 標誌位。blk_add
- 要寫的起始塊號。num_blk
- 寫的塊的數量。uid
- UID信息。data
- 返回值。public static int API_ISO15693Lock(int commHandle, int DeviceAddress, byte flags, byte num_blk, byte[] uid, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。flags
- 標誌位。num_blk
- 要鎖的塊號。uid
- UID信息。buffer
- 返回值。public static int API_ISO15693StayQuiet(int commHandle, int DeviceAddress, byte flags, byte[] uid, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。flags
- 標誌位。uid
- UID信息。buffer
- 返回值。public static int API_ISO15693Select(int commHandle, int DeviceAddress, byte flags, byte[] uid, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。flags
- 標誌位。uid
- UID信息。buffer
- 返回值。public static int API_ResetToReady(int commHandle, int DeviceAddress, byte flags, byte[] uid, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。flags
- 標誌位。uid
- UID信息。buffer
- 返回值。public static int API_WriteAFI(int commHandle, int DeviceAddress, byte flags, byte afi, byte[] uid, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。flags
- 標誌位。afi
- 待寫的AFI.uid
- UID信息。buffer
- 返回值。public static int API_LockAFI(int commHandle, int DeviceAddress, byte flags, byte[] uid, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。flags
- 標誌位。uid
- UID信息。buffer
- 返回值。public static int API_WriteDSFID(int commHandle, int DeviceAddress, byte flags, byte DSFID, byte[] uid, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。flags
- 標誌位。DSFID
- 要寫的DSFID字節,長度為1個字節.uid
- UID信息。buffer
- 返回值。public static int API_LockDSFID(int commHandle, int DeviceAddress, byte flags, byte[] uid, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。flags
- 標誌位。uid
- UID信息。buffer
- 返回值。public static int API_ISO15693_GetSysInfo(int commHandle, int DeviceAddress, byte flags, byte[] uid, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。flags
- 標誌位。uid
- UID信息。buffer
- 返回值.public static int API_ISO15693_GetMulSecurity(int commHandle, int DeviceAddress, byte flags, byte blkAddr, byte blkNum, byte[] uid, byte[] pBuffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。flag
- 標誌位。blkAddr
- 要讀的起始塊號。blkNum
- 讀的塊的數量。uid
- UID信息。pBuffer
- 返回值。public static int API_ISO15693TransCOSCmd(int commHandle, int DeviceAddress, byte[] cmd, int cmdSize, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。cmd
- 需要發送的數據。cmdSize
- 數據長度。buffer
- 返回值。public static int UL_HLRead(int commHandle, int DeviceAddress, byte mode, byte blk_add, byte[] snr, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。mode
- 尋卡模式 。blk_add
- 寫卡扇區號。snr
- 返回7個字節的卡號。buffer
- 返回16個字節的卡數據。public static int UL_HLWrite(int commHandle, int DeviceAddress, byte mode, byte blk_add, byte[] snr, byte[] buffer)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。mode
- 尋卡模式 。blk_add
- 寫卡扇區號。snr
- 返回7個字節的卡號。buffer
- 四個字節的寫入卡扇區的數據。public static int UL_Request(int commHandle, int DeviceAddress, byte mode, byte[] snr)
commHandle
- 操作的串口。DeviceAddress
- 設備地址。mode
- 尋卡模式 。snr
- 待返回的參數