|
@@ -32,6 +32,10 @@ public class RfidReaderUtil {
|
|
|
public TagData[] readTags() {
|
|
|
TagData[] readTags = null;
|
|
|
try {
|
|
|
+ if (!reader.isConnected()) {
|
|
|
+ throw new Exception("连接已经断开!");
|
|
|
+ }
|
|
|
+
|
|
|
// 清空标签
|
|
|
reader.Actions.purgeTags();
|
|
|
|
|
@@ -42,9 +46,6 @@ public class RfidReaderUtil {
|
|
|
reader.Actions.Inventory.stop();
|
|
|
|
|
|
readTags = reader.Actions.getReadTags(properties.getNumberOfTags());
|
|
|
- if (readTags == null) {
|
|
|
- throw new Exception("读取标签为空!");
|
|
|
- }
|
|
|
} catch (Exception e) {
|
|
|
log.error("RfidReader读取异常!", e);
|
|
|
reader = new RFIDReader(properties.getHost(), properties.getPort(), properties.getTimeoutMilliseconds());
|