?? rfidreadersettings.java
字號:
package hfut.wispy.webservice;
public class RFIDReaderSettings {
public static boolean isDebug = false;
public enum ReaderModel {
YWG804_6c_once, YWG804_6c_cycle;
}
public String CfgFile;
public String CfgItem;
public byte Antenna;
public byte IsCycleRead;
public int CycleReadTime;
public int EPCLength;
public int ReturnByteArrayLength;
public byte[] NullTag;
public int InitialUnReadTimes;
public int TagLifeInListArray;
public RFIDReaderSettings() {
init(ReaderModel.YWG804_6c_once);
}
public RFIDReaderSettings(ReaderModel model) {
init(model);
}
private void init(ReaderModel model) {
switch (model) {
default:
case YWG804_6c_once:
commonInit();
Antenna = (byte) 0x01;
IsCycleRead = (byte) 0x00;
CycleReadTime = 3;
e("CfgFile : " + CfgFile);
e("CfgItem : " + CfgItem);
e("Antenna : " + Antenna);
e("ReadTimes : " + IsCycleRead);
e("CycleReadTime : " + CycleReadTime);
e("EPCLength : " + EPCLength);
break;
case YWG804_6c_cycle:
commonInit();
Antenna = (byte) 0x01;
IsCycleRead = (byte) 0x01;
CycleReadTime = 1;
e("CfgFile : " + CfgFile);
e("CfgItem : " + CfgItem);
e("Antenna : " + Antenna);
e("ReadTimes : " + IsCycleRead);
e("CycleReadTime : " + CycleReadTime);
e("EPCLength : " + EPCLength);
break;
}
}
private void commonInit() {
EPCLength = 12;
ReturnByteArrayLength = 17;
NullTag = new byte[ReturnByteArrayLength];
for (int i = 0; i < NullTag.length; i++) {
NullTag[i] = (byte) (-52);
}
CfgFile = "C:\\WINDOWS\\system32\\sysit.cfg";
CfgItem = "XCRF-804 Reader";
InitialUnReadTimes = 40;
TagLifeInListArray = 10 * 1000;// 10second
}
public static boolean IsSameByteArray(byte[] b1, byte[] b2) {
if (b1 == null || b2 == null)
return false;
else if (b1.length != b2.length)
return false;
else {
for (int i = 0; i < b1.length; i++) {
if (b1[i] != b2[i])
return false;
}
return true;
}
}
/**
* Util: stderr print method.
*/
public static void e(String s) {
if (isDebug)
System.out.println("RFIDReaderSettings: " + s);
}
/**
* Util: stdout print method.
*/
public static void p(String s) {
System.out.println(s);
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -