UHFManager
This class has been abandoned and will not be updated and maintained later. Please use UHF manager UHFManager
author CYD email jszc@idatachina.com 注意: 1.此API与Demo只适用于UM系列模块,使用前请确认您的机器已安装此模块 2.此API与Demo只适用于50系列和25系列的UHF设备,使用前确认机型 3.使用此API需要libjni_rfid_driver.so和RFIDJar_Vx.x.x.jar 4.初始化一次MyLib对象并执行上电
powerOn()
操作成功之后,方可使用此类的其它API 5.MonzaR6数据格式的标签操作请参照下图: Attention. 1. This API and Demo only apply to the UM series modules, please make sure your machine has this module installed before use. 2. This API and demo are only applicable to 50 series and 25 series UHF devices, please make sure your machine has this module installed before using. 3. libjni_rfid_driver.so and RFIDJar_Vx.x.x.jar are required to use this API. 4. Initialize MyLib object once and perform power onpowerOn()
operation successfully before you can use other APIs of this kind. 5. Please refer to the following figure for the tagging operation of MonzaR6 data format.
public class MyLib extends UHFManager
Modifier and Type | Field and Description |
---|---|
int |
EPC
Deprecated.
EPC区(area)
|
int |
RESERVED
Deprecated.
保留区(Reserved area)
|
int |
TID
Deprecated.
TID区(area)
|
int |
USR
Deprecated.
USR区(area)
|
con
Constructor and Description |
---|
MyLib()
Deprecated.
|
MyLib(android.content.Context con)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
boolean |
filterSet(int bank,
int ptr,
int cnt,
java.lang.String data,
boolean save)
Deprecated.
设置标签过滤条件 Set tag filter conditions
|
java.lang.String |
firmwareVerGet()
Deprecated.
固件版本号获取 Firmware version number acquisition
|
int[] |
frequenceRange_Get()
Deprecated.
获取设置频点范围 Get set frequency range
|
boolean |
frequenceRange_Set(int freqCnt,
int[] freqList,
boolean ifSave)
Deprecated.
设置频点范围,最多50个 Set frequency range, up to 50
|
int |
frequencyModeGet()
Deprecated.
获取模块当前的区域频率(包含定频) Get the current area frequency of the module (including fixed frequency)
(915Mhz已废弃,后续可能移除对应值,替代方案可参考
frequenceRange_Get() )
915Mhz has been deprecated, the corresponding value may be removed in the future, alternative solutions can be referred to |
int |
frequencyModeGetNotFixedFreq()
Deprecated.
获取功率,不包含定频 Get power, not including fixed frequency
|
boolean |
frequencyModeSet(int freMode)
Deprecated.
设置模块的区域频率 Set the area frequency of the module
(915Mhz已废弃,后续可能移除对应值,替代方案可参考
frequenceRange_Set(int, int[], boolean) )
915Mhz has been deprecated, the corresponding value may be removed in the future, alternative solutions can be referred tofrequenceRange_Set(int, int[], boolean) ) |
java.lang.String |
getLibVer()
Deprecated.
获取当前Lib的版本号
Get the version number of the current Lib
|
java.lang.String |
getUHFModuleType()
Deprecated.
只支持SLR模块 Only support SLR Module
获取当前UHF(SLR系列)模块类型 Get current UHF(SLR Series) module type
|
java.lang.String |
hardwareVerGet()
Deprecated.
硬件版本号获取 Hardware version number acquisition
|
int |
inventoryModelGet()
Deprecated.
获取标签盘点的模式 Get the pattern of the label inventory
|
boolean |
inventoryModelSet(int mode,
boolean save)
Deprecated.
设置标签盘点的模式 Set the mode of label inventory
|
int[] |
inventoryWaitTime_Get()
Deprecated.
获取设置的盘点和休眠的时间 Get the set inventory and hibernation time
|
boolean |
inventoryWaitTime_Set(int scanTime,
int waitTime,
boolean save)
Deprecated.
设置盘点时间的占空比 Set duty cycle for inventory time
|
boolean |
killTag(java.lang.String killPwd,
int bank,
int ptr,
int cnt,
java.lang.String data)
Deprecated.
销毁标签操作 Destroy label operation
|
boolean |
lockMen(java.lang.String accessPwd,
int bank,
int ptr,
int cnt,
java.lang.String data,
int bank1)
Deprecated.
锁标签操作(临时锁,可解锁)Lock tag operation (temporary lock, can be unlocked)
|
int |
powerGet()
Deprecated.
获取模块的功率 Get the power of the module
|
boolean |
powerOff()
Deprecated.
下电关闭UHF设备
Power down and shut down UHF equipment
|
boolean |
powerOn()
Deprecated.
上电打开UHF设备 Power up and turn on the UHF device
|
boolean |
powerSet(int power)
Deprecated.
设置模块的功率 Setting the power of the module
|
java.lang.String |
readTag(java.lang.String accessPwd,
int bank,
int ptr,
int len,
java.lang.String data,
int bank1,
int ptr1,
int len1)
Deprecated.
读标签操作(可指定过滤条件,一次最多可读16个word) Read tag operation (can specify filter conditions, can read up to 16 words at a time)
|
java.lang.String[] |
readTagFromBuffer()
Deprecated.
读取缓冲区返回的标签的TID和EPC Read the TID and EPC of the tag returned from the buffer
|
int |
readTagModeGet()
Deprecated.
获得当前标签盘点的返回的数据种类 Get the type of data returned for the current tag inventory
|
boolean |
readTagModeSet(int mode,
boolean ifSave)
Deprecated.
设置标签盘点返回的数据种类 Get the type of data returned for the current tag inventory
|
int |
sessionModeGet()
Deprecated.
获取当前session模式 Get the current session mode
|
boolean |
sessionModeSet(int sessionValue)
Deprecated.
设置session模式 set session mode
|
int |
slrInventoryModelGet()
Deprecated.
UM模块不支持此功能 the um module does not support this feature
|
boolean |
slrInventoryModeSet(int mode)
Deprecated.
UM模块不支持此功能 the um module does not support this feature
0 将设置session1 并且使用快速模式 0 will set session1 and use quick mode
2 使用快速模式 session 1 2 use quick mode session 1
|
boolean |
startInventoryTag()
Deprecated.
开启标签读取操作 Enabling tag reading operation
|
boolean |
stopInventory()
Deprecated.
停止标签读取操作 Stop tag reading operation
|
boolean |
unlockMen(java.lang.String accessPwd,
int bank,
int ptr,
int cnt,
java.lang.String data,
int bank1)
Deprecated.
解锁标签操作 Unlock label operation
|
boolean |
updateFirmware(java.lang.String filePath,
java.lang.String fileName)
Deprecated.
更新固件 Update firmware
|
boolean |
write1KData(java.lang.String accessPwd,
int bank,
int ptr,
int len,
java.lang.String data,
int bank1,
int ptr1,
int len1,
java.lang.String data1)
Deprecated.
一次最多写1K的数据,用法以及返回参照
writeTag(String, int, int, int, String, int, int, int, String) |
boolean |
writeDataToEpc(java.lang.String accessPwd,
int ptr,
int cnt,
java.lang.String data)
Deprecated.
向标签的EPC区写数据(不带过滤) Write data to the EPC area of the tag (without filtering)
|
boolean |
writeTag(java.lang.String accessPwd,
int bank,
int ptr,
int len,
java.lang.String data,
int bank1,
int ptr1,
int len1,
java.lang.String data1)
Deprecated.
写标签操作(可指定过滤条件,一次最多写16word)Write tag operation (can specify filter conditions, write up to 16 words at a time)
|
changeConfig, clearConfigInfo, getDeviceInfo, getType, getUHFImplSigleInstance, ifJ06
public final int RESERVED
public final int EPC
public final int TID
public final int USR
public MyLib(android.content.Context con)
public MyLib()
public boolean powerOn()
powerOn
in class UHFManager
public boolean powerOff()
powerOff
in class UHFManager
public int powerGet()
public boolean powerSet(int power)
power
- 传入的功率值 Incoming power valuepublic boolean frequencyModeSet(int freMode)
frequenceRange_Set(int, int[], boolean)
)
915Mhz has been deprecated, the corresponding value may be removed in the future, alternative solutions can be referred tofrequenceRange_Set(int, int[], boolean)
)freMode
- 0:中国China(840-845MHz),1:中国china(920-925MHz),2:欧洲Europe(865-868MHz),
3:美国America(902-928MHz),4:915MHz,5:UM2定制频点(Only UM2 Device)public int frequencyModeGet()
frequenceRange_Get()
)
915Mhz has been deprecated, the corresponding value may be removed in the future, alternative solutions can be referred tofrequencyModeSet(int)
的参数freMode
Returns the spinner subscript corresponding to the frequency, the values 0, 1, 2, 3, 4 , refer to the parameter freMode of frequencyModeSet(int)
for details.public int frequencyModeGetNotFixedFreq()
frequencyModeSet(int)
public boolean startInventoryTag()
public boolean stopInventory()
public java.lang.String[] readTagFromBuffer()
标签读取使用完整示例 Full example of tag reading usageFull example of tag reading usage
MyLib mb = new MyLib(...)://Context对象请自行填入 Please fill in the Context object yourself
if(mb.powerOn()&& mb.startInventoryTag()){
new Thread(new Runnable() {
@Override
public void run() {
while (true) {
String[] tagData = mb.readTagFromBuffer();
if (tagData != null) {
MLog.e("tid_user = " + tagData[0] + " epc = " + tagData[1] + " rssi = " + tagData[2]);
}
}
}
}).start();
}
public boolean filterSet(int bank, int ptr, int cnt, java.lang.String data, boolean save)
bank
- 需要过滤的存储区,RESERVED
,EPC
,TID
,USR
The storage area to be filtered is detailed inRESERVED
,EPC
,TID
,USR
ptr
- 过滤起始地址(bit类型) Filter start address (bit type)cnt
- 过滤数据长度(bit类型) Filter data length (bit type)data
- 用来过滤的数据 Data to be used for filteringsave
- 是否掉电保存 Whether to power down and savepublic boolean lockMen(java.lang.String accessPwd, int bank, int ptr, int cnt, java.lang.String data, int bank1)
accessPwd
- 标签RESERVED区的Access Password Access password for label reservebank
- 标签的存储区 ,详见 The storage area of the label , seeRESERVED
,EPC
,TID
,USR
ptr
- 过滤的起始地址(bit类型) Starting address for filtering (bit type)cnt
- 过滤的数据长度(bit类型) Filtered data length (bit type)data
- 需要过滤的数据 Data to be filteredbank1
- 锁定指定区域,详见 Lock the specified area, seeRESERVED
,EPC
,TID
,USR
锁标签用法示例 Example of lock tag usage MyLib mb = new MyLib(...)://Context对象请自行填入 Please fill in the object yourself if(mb.powerOn()){ String accessPwd = "00000000"; int bank = mb.EPC;//(或者直接int bank =1); 过滤的区域(or just int bank =1); filtered area int ptr = 32; int cnt = 96; String data = "1234567890ABCDEF12345678"; int bank1=mb.EPC; mb.lockMen(accessPwd,bank,ptr,cnt,data,bank1); }
public boolean unlockMen(java.lang.String accessPwd, int bank, int ptr, int cnt, java.lang.String data, int bank1)
accessPwd
- 标签RESERVED区的Access Password Access password for label reservebank
- 标签的存储区,详见 The storage area for the labels, as detailed inRESERVED
,EPC
,TID
,USR
ptr
- 过滤的起始地址(bit类型) Starting address for filtering (bit type)cnt
- 过滤的数据长度(bit类型) Filtered data length (bit type)data
- 需要过滤的数据 Data to be filteredbank1
- 解锁指定区域,详见 Unlock the designated area as detailed inRESERVED
,EPC
,TID
,USR
public boolean writeDataToEpc(java.lang.String accessPwd, int ptr, int cnt, java.lang.String data)
accessPwd
- 标签RESERVED区的Access Password Access password for label reserveptr
- 开始写入的起始位置 Start of write start positioncnt
- 写入数据的长度(Word类型,大于0) Length of written data (Word type, greater than 0)data
- 需要写入的数据(16进制) Data to be written (hexadecimal)public boolean writeTag(java.lang.String accessPwd, int bank, int ptr, int len, java.lang.String data, int bank1, int ptr1, int len1, java.lang.String data1)
accessPwd
- 标签RESERVED区的Access Password Access password for label reservebank
- 过滤的标签的存储区 ,详见 The storage area for filtered tags is described in RESERVED
,EPC
,TID
,USR
ptr
- 过滤的起始地址(bit类型) Starting address for filtering (bit type)len
- 过滤的数据长度(bit类型) Filtered data length (bit type)data
- 需要过滤的数据 Data to be filteredbank1
- 需要写入的标签储存区,详见 The label storage area to be written to is described in RESERVED
,EPC
,TID
,USR
ptr1
- 写入的起始地址 Start address of write in(Word类型) 注:1word =2byte=16bitlen1
- 写入的数据长度(Word类型,大于0) Length of the written data (Word type, greater than 0)data1
- 写入的具体数据 Specific data to be written写标签操作的完整示例 Full example of a write tag operation MyLib mb = new MyLib(...)://Context对象请自行填入 Please fill in the object yourself if(mb.powerOn()){ String pwd="00000000"; int bank = mb.EPC;//(或者直接int bank =1)Or just int bank =1; int ptr =32; int len =96; String data="1234567890ABCDEF12345678"; int bank1=mb.EPC; int ptr1=2; int len1=6; String data1="1234567890ABCDEF12345679"; mb.writeTag(pwd,bank,ptr,len,data,bank1,ptr1,len1,data1); }
public java.lang.String readTag(java.lang.String accessPwd, int bank, int ptr, int len, java.lang.String data, int bank1, int ptr1, int len1)
accessPwd
- 标签RESERVED区的Access Password Access Password in the RESERVED area of the tagbank
- 需要过滤操作的标签的存储区,详见 The storage area for tags that require filtering operations, as detailed inRESERVED
,EPC
,TID
,USR
ptr
- 过滤的起始地址(bit类型) Starting address for filtering (bit type)len
- 过滤的数据长度(bit类型) Filtered data length (bit type)data
- 需要过滤的数据 Data to be filteredbank1
- 需要读取的标签储存区,详见 The tag storage area to be read, as detailed inRESERVED
,EPC
,TID
,USR
ptr1
- 读取的起始地址(Word类型) Starting address to be read (Word type)len1
- 读取的数据长度(Word类型,大于0) Length of data to be read (Word type, greater than 0)public boolean killTag(java.lang.String killPwd, int bank, int ptr, int cnt, java.lang.String data)
killPwd
- 标签RESERVED区的Kill Password Kill Password in the RESERVED area of the tagbank
- 标签的存储区,详见 The storage area for the labels, as detailed inRESERVED
,EPC
,TID
,USR
ptr
- 过滤的起始位置(bit类型) Starting position of filtering (bit type)cnt
- 过滤数据的长度(bit类型) Length of filtered data (bit type)data
- 过滤用的的数据 Data for filteringpublic java.lang.String hardwareVerGet()
public java.lang.String firmwareVerGet()
public boolean updateFirmware(java.lang.String filePath, java.lang.String fileName)
filePath
- 固件文件存放在SD卡的绝对路径 The absolute path of the firmware file stored in the SD cardfileName
- 固件文件名 Firmware file namepublic boolean readTagModeSet(int mode, boolean ifSave)
mode
- 设置0只读取标签EPC,1读取标签EPC和TID,2读取标签EPC和USER
ifSave
- 是否掉电保存 Whether to power down and savepublic int readTagModeGet()
public boolean sessionModeSet(int sessionValue)
sessionValue
- session模式的值,0~3表示S0到S3 sessionValue The value of session mode, 0~3 means S0 to S3public int sessionModeGet()
public boolean inventoryModelSet(int mode, boolean save)
mode
- 0:多标签模式,侧重读全标签 ,1:快盘模式,侧重快速读取标签 ,2.低功耗模式,3.测试模式, 4:省电模式
0: multi-tag mode, focusing on reading the full tag, 1: fast disk mode, focusing on fast reading tags,2:Low power mode,3:Test mode, 4: power-saving modesave
- 是否下电保存 Whether to power down and savepublic int inventoryModelGet()
inventoryModelSet(int, boolean)
#mode,其它值失败
Return value 0, 1 refer to inventoryModelSet(int, boolean)
#mode, other values failpublic boolean write1KData(java.lang.String accessPwd, int bank, int ptr, int len, java.lang.String data, int bank1, int ptr1, int len1, java.lang.String data1)
writeTag(String, int, int, int, String, int, int, int, String)
accessPwd
- 标签RESERVED区的Access Password Access password for label reservebank
- 过滤的标签的存储区 ,详见RESERVED
,EPC
,TID
,USR
ptr
- 过滤的起始地址(bit类型)len
- 过滤的数据长度(bit类型)data
- 需要过滤的数据bank1
- 需要写入的标签储存区,详见RESERVED
,EPC
,TID
,USR
ptr1
- 写入的起始地址(Word类型) 注:1word =2byte=16bitlen1
- 写入的数据长度(Word类型,大于0)data1
- 写入的具体数据public boolean inventoryWaitTime_Set(int scanTime, int waitTime, boolean save)
scanTime
- 盘点的时间 Time of InventorywaitTime
- 休眠的时间 Duration of dormancysave
- 是否下电保存 Whether to power down and savepublic int[] inventoryWaitTime_Get()
public boolean frequenceRange_Set(int freqCnt, int[] freqList, boolean ifSave)
freqCnt
- 频点数量 Number of frequency pointsfreqList
- 频点值 Frequency point valueifSave
- 是否下点保存 Whether to save under the pointpublic int[] frequenceRange_Get()
public java.lang.String getLibVer()
public boolean slrInventoryModeSet(int mode)
UHFFunction
public int slrInventoryModelGet()
UHFFunction
public java.lang.String getUHFModuleType()
UHFFunction