|
|
@ -85,21 +85,32 @@ public class AutoID9UDevice implements RFIDModel {
|
|
|
|
public void sanUser(int len) {
|
|
|
|
public void sanUser(int len) {
|
|
|
|
var power = uhfService.getPower();
|
|
|
|
var power = uhfService.getPower();
|
|
|
|
Log.e("TAG", "设备功率:" + power);
|
|
|
|
Log.e("TAG", "设备功率:" + power);
|
|
|
|
|
|
|
|
if (power==0){
|
|
|
|
|
|
|
|
uhfService.close();
|
|
|
|
|
|
|
|
uhfService = UHFService.getInstance();
|
|
|
|
|
|
|
|
uhfService.open();
|
|
|
|
|
|
|
|
Log.e("TAG", "设备功率:" + uhfService.getPower());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (id==null){
|
|
|
|
|
|
|
|
String info = null;
|
|
|
|
|
|
|
|
EPC epc=new EPC();
|
|
|
|
|
|
|
|
var result = uhfService.inventoryOnce(epc, 100);
|
|
|
|
|
|
|
|
Log.e("TAG", "单次寻卡:" + result);
|
|
|
|
|
|
|
|
Log.e("TAG", "epcid:" + epc.getId());
|
|
|
|
|
|
|
|
id=epc.getId();
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String info = null;
|
|
|
|
// if (result) {
|
|
|
|
EPC epc=new EPC();
|
|
|
|
|
|
|
|
var result = uhfService.inventoryOnce(epc, 100);
|
|
|
|
|
|
|
|
Log.e("TAG", "epcid:" + epc.getId());
|
|
|
|
|
|
|
|
if (result) {
|
|
|
|
|
|
|
|
var i = len * 2;
|
|
|
|
var i = len * 2;
|
|
|
|
byte[] data = new byte[i];
|
|
|
|
byte[] data = new byte[i];
|
|
|
|
result = uhfService.readTagData(AutoID9UUtil.getHexByteArray(epc.getId()), password, 3, 0, i, data);
|
|
|
|
var result = uhfService.readTagData(AutoID9UUtil.getHexByteArray(id), password, 3, 0, i, data);
|
|
|
|
Log.e("TAG", "按长度读取:" + result);
|
|
|
|
Log.e("TAG", "按长度读取:" + result);
|
|
|
|
if (result) {
|
|
|
|
if (result) {
|
|
|
|
info = Tools.Bytes2HexString(data, data.length);
|
|
|
|
var info = Tools.Bytes2HexString(data, data.length);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
call.readUserInfo(info,result,null);
|
|
|
|
// call.readUserInfo(info,result,null);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|