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
- 待返回的参数