LLRP protocol and networking for Java
= LLRP4J - LLRP for Java image:https://travis-ci.org/enilink/llrp4j.svg?branch=master["Build Status", link="https://travis-ci.org/enilink/llrp4j"]
LLRP protocol and networking implementation for Java.
LLRP4J implements encoders and decoders for the binary and (proprietary) XML serializations of the http://www.gs1.org/epcrfid/epc-rfid-llrp/1-1-0[Low Level Reader Protocol (LLRP)].
LLRP4J consists of the following modules:
final LlrpContext ctx = LlrpContext.create(new LlrpModule()); LlrpEndpoint endpoint = new LlrpEndpoint() { @Override public void messageReceived(LlrpMessage message) { StringWriter writer = new StringWriter(); try { XMLStreamWriter xmlWriter = XMLOutputFactory.newInstance().createXMLStreamWriter(writer); ctx.createXmlEncoder(true).encodeMessage(message, xmlWriter); String xml = writer.toString(); System.out.println("RECEIVED:\n" + xml); } catch (Exception e) { // handle exception } }
@Override public void errorOccured(String message, Throwable cause) { } }; LlrpServer server = LlrpServer.create(ctx, "127.0.0.1").endpoint(endpoint); LlrpClient client = LlrpClient.create(ctx, "127.0.0.1").endpoint(endpoint);
client.transact(new SET_READER_CONFIG().resetToFactoryDefault(true));
== Get the sources
== Build LLRP4J
LLRP4J can be build with Maven. You can simply use mvn -P generator package
to compile and package all modules or mvn -P generator install
to install them within your local Maven repository.
== Differences to LLRP Toolkit for Java
A popular implementation of LLRP in Java is the http://www.sourceforge.net/projects/llrp-toolkit[LLRP Toolkit (LTK) for Java]. Its development has been stalled since 2012 and hence we decided to create a new LLRP library for Java with the following benefits:
== License
LLRP4J is licensed under the Eclipse Public License v1.0.
== Acknowledgements
The networking module is based on the http://rox-xmlrpc.sourceforge.net/niotut/[Rox Java NIO Tutorial] and the bit buffer implementation is a fork of https://github.com/magik6k/BitBuffer.