UHF Development Document v1.
0
I. Adding Jar and So Library Files to the Project
Place the jar file and so library files into the project.
Ensure that targetSdkVersion is not lower than 26, as shown in the figure below:
1.1 getInstance()
函数 UHFRManager getInstance()
说明 Get an instance of the UHF operation class and open the hardware device
a
参数 无
返回 UHFRManager instance 超高频操作实例
1.2 getHardware()
函数 String getHardware()
说明 Get hardware version information of the device
a
参数 无
String 硬件信息字符串
返回 Null 获取失败
1.3 asyncStartReading()
函数 READER_ERR asyncStartReading()
说明 Start multi-tag mode to read EPC
a
参数 无
READER_ERR 错误类
成功:Reader.READER_ERR.MT_OK_ERR
返回 失败:错误信息
1.4 asyncStopReading()
函数 READER_ERR asyncStopReading()
Stop multi-tag mode to read EPC, used in conjunction with
说明 asyncStartReading().
a
参数 无
READER_ERR 错误类
成功:Reader.READER_ERR.MT_OK_ERR
返回 失败:错误信息
1.10 getTagData()
READER_ERR getTagData(int mbank, int startaddr, int len,
函数 byte[] rdata, byte[] password, short timeout)
获取标签数据,即读标签
说明 "Get tag data, i.e., read tag."
a
int mbank, 读取标签的区域,0:RESERVED 区,1:EPC 区,2:TID 区,3:USER 区
int startaddr, 读取标签的起始地址,单位 word
int len, 读取标签数据的长度
byte[] rdata, 读取的数据,用于保存读到的数据,长度与 len 一致
byte[] password, 访问密码,4byte 数据,
short timeout,读取的超时时间,单位:毫秒
- `int mbank`: Read area of the tag, 0: RESERVED area, 1: EPC area, 2: TID area, 3:
USER area.
- `int startaddr`: Start address for reading the tag, in words.
- `int len`: Length of data to read from the tag.
- `byte[] rdata`: Data read from the tag, used to save the read data, with a length
equal to `len`.
- `byte[] password`: Access password, 4-byte data.
参数 - `short timeout`: Read timeout in milliseconds.
READER_ERR 错误类
成功:Reader.READER_ERR.MT_OK_ERR
返回 失败:错误信息
1.24 setPower()
函数 READER_ERR setPower(int readPower, int writePower)
说明 "Set the radio frequency power of the device."
a
- `int readPower`: Read power, range: 5~30.
参数 - `int writePower`: Write power, range: 5~30.
- `READER_ERR`: Error class.
- Success: `Reader.READER_ERR.MT_OK_ERR`
返回 - Failure: Error message
1.25 getPower()
函数 int[] getPower()
说明 "Get the radio frequency power of the device."
a
参数 无
Int[] 成功,int[0]为读功率,int[1]为写功率
返回 Null 获取失败
1.26 setFastMode()
函数 READER_ERR setFastMode()
"Set fast mode/multi-tag mode with maximum power. Refer to the demo source
说明 code for usage."
a
参数 无
List<EPCDataModel>:盘点到的数据列表
返回 Null:未盘点到标签
1.28 close()
函数 Boolean close()
说明 "Turn off UHF device hardware power supply and disconnect data connection."
a
参数 无
返回 True 关闭成功