public class RFIDWithUHF706
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
int |
configPower()
将所有天线设置为27dbm
|
int |
EventReport()
停止读
|
boolean |
free()
关闭UHF模块
|
byte[] |
getAccess()
获取权限表
|
static RFIDWithUHF706 |
getInstance()
获取UHF操作实例
|
byte[] |
getPara(int type)
获取参数设置
|
long |
getRTC()
获取RTC时间
|
boolean |
init()
初始化UHF模块
|
boolean |
isPowerOn()
判断设备是否上电
|
byte[] |
readInfo()
安全模块主动向设备上传识读信息
|
byte[] |
requestRandom()
向安全模块请求随机数
|
int |
requsetReadPart(byte speed,
byte des,
byte flag,
byte partnum,
byte ptr,
byte len)
读分区请求
|
int |
requsetWritePart(byte[] tid,
byte num,
byte startaddr,
byte[] buf)
写分区请求
|
int |
sendActiveFile(byte transmode,
byte[] deviceid,
byte[] reverse,
byte[] transbuf)
向安全模块发送激活文件
|
int |
sendAuthData(byte[] hrandom,
byte[] srandom,
byte[] devid,
byte[] reserve,
byte[] signature,
byte[] certbuf)
向安全模块发送认证数据
|
byte[] |
sendUserInfo(byte[] province,
byte[] city,
byte[] jw,
byte[] usage,
byte[] type1,
byte[] com_name,
byte[] people,
byte[] tel1,
byte[] tel2,
byte[] email,
byte[] data,
byte[] ps)
向安全模块发送 用户信息数据
|
int |
SetInventorySper()
开始读
|
int |
setPara(int type,
byte[] data)
设置参数
|
int |
setRTC(long time)
设置RTC时间
|
int |
SetTestMode()
设置为测试模式
|
int |
setWorkMode(int nums,
byte[] modebuf)
设置安全模块的工作模式
|
byte[] |
TransBuf(byte oper,
byte[] buf)
数据转发透传
|
int |
writeSpecialPart(byte[] buf)
专用指定标签写分区
|
public int configPower()
public int EventReport()
public boolean free()
public byte[] getAccess()
public static RFIDWithUHF706 getInstance() throws ConfigurationException
ConfigurationException
- 配置错误异常public byte[] getPara(int type)
type
- 参数类型public long getRTC()
public boolean init()
public byte[] readInfo()
public byte[] requestRandom()
public int requsetReadPart(byte speed, byte des, byte flag, byte partnum, byte ptr, byte len)
speed
- 1:高速读 ,0:普通读des
- 1:明文返回 ,0:密文返回flag
- 分区访问指示 0:下半区,1:上半区 2:全区 3:国标指令partnum
- 分区号ptr
- 指针 2字节(只有国标指令时 使用)len
- 长度 2字节(只有国标指令时 使用)public int requsetWritePart(byte[] tid, byte num, byte startaddr, byte[] buf)
tid
- 实际标签的TID 8字节num
- 分区 1字节startaddr
- 开始写入的地址buf
- 数据public int sendActiveFile(byte transmode, byte[] deviceid, byte[] reverse, byte[] transbuf)
transmode
- 传输方式 1字节deviceid
- 设备序列号 8字节reverse
- 保留 5字节transbuf
- 转发给安全模块的数据 200字节public int sendAuthData(byte[] hrandom, byte[] srandom, byte[] devid, byte[] reserve, byte[] signature, byte[] certbuf)
hrandom
- 主机PDA产生8字节随机数srandom
- 安全模块返回的8字节随机数devid
- 主机8字节设备序列号(2字节厂家代码+6字节序列号)reserve
- 保留区 8字节signature
- 对上面32字节数据的签名,签名数据共64字节certbuf
- 密钥管理中心 颁发给厂家的 数字证书 X509 格式public byte[] sendUserInfo(byte[] province, byte[] city, byte[] jw, byte[] usage, byte[] type1, byte[] com_name, byte[] people, byte[] tel1, byte[] tel2, byte[] email, byte[] data, byte[] ps)
province
- 省,10字节city
- 市,10字节jw
- 经纬度,6字节usage
- 用途,20字节type1
- 设备型号,8字节com_name
- 公司名称,40字节people
- 联系人 ,10字节tel1
- 联系电话1,5字节tel2
- 联系电话2, 5字节email
- 邮箱 ,30字节data
- 登记日期,5字节ps
- 备注,75字节public int SetInventorySper()
public int setPara(int type, byte[] data)
type
- 参数类型data
- 参数内容public int setRTC(long time)
time
- 1970年 至今的毫秒数public int SetTestMode()
public int setWorkMode(int nums, byte[] modebuf)
nums
- 要设置的分区数量modebuf
- 设置分区的数据,长度为 7*nums(根据分区的数量 改变长度, 每个分区 用7个字节表示) 索引1: 分区号 0-5
索引2: 0为读分区下半区,1为读分区上半区, 2为 读全区 ,3为分两次读全区 ,4为国标指令读全区(目前不支持国标读)
索引3: 高半字节 0:读取的数据是密文 1: 读取的数据是明文,低半字节 0:高速读取 1:否 索引4-索引5:
国标读时,表示读取字地址, 行标读时,置0 索引6-索引7: 国标读时, 表示读取字长度, 行标读时,置0public byte[] TransBuf(byte oper, byte[] buf)
oper
- 操作标识jbuf
- 数据public int writeSpecialPart(byte[] buf)
buf
- 数据public boolean isPowerOn()