我正在为Rifidi Edge Server 3.3开发Motorola RFID阅读器适配器,参考已有的Rifidi CSL Reader Adapter。 类似于CSL Reader Adapter的CslRfidTagServer.java类我在我的适配器中创建了MotoRfidTagServer.java,我不断从物理motorola阅读器接收标签。我将所有标签添加到ReadCycle但是我的Rifidi应用程序的Readzonesubscriber类中只有单个标签而不是所有标签。请为此提供一些解决方案。
我的传感器会话类如下:
public class MotoSocketSensorSession extends AbstractServerSocketSensorSession {
.......
.......
public void sendTag(byte[] message) {
String s = new String(message);
System.out.println("tags--------------------------"+s);
**// Getting each tags here**
TagReadEvent event = this.tagHandler.parseTag(new String(message));
Set<TagReadEvent> tres = new HashSet<TagReadEvent>();
tres.add(event);
ReadCycle cycle = new ReadCycle(tres, readerID,System.currentTimeMillis());
this.getSensor().send(cycle);
}
private class MotoSocketMessageProcessingStrategy implements
MessageProcessingStrategy {
private MotoSocketSensorSession session = null;
public MotoSocketMessageProcessingStrategy(MotoSocketSensorSession session) {
this.session = session;
}
@Override
public void processMessage(byte[] message) {
this.session.sendTag(message);
}
}
.......
.......
}
我的Rifidi应用程序的ReadZoneSubscriber如下:
public class AtsReadZoneSubscriber implements ReadZoneSubscriber {
@Override
public void tagArrived(TagReadEvent tag) {
System.out.println("TAG ARRIVED ->: " + tag.getTag().getFormattedID() + "At ReaderId: "+tag.getReaderID()+" from antenna: " + tag.getAntennaID());
**//I am getting only single tag here only at once**
}
..........
..........
}