This guide shall introduce Logical Readers and how they can be declared to be used in the Filtering and Collection server.
There are two different types of Logical Reader Definitions that should not be confused!
Dynamic Logical Reader Definitions are read by the fc-client and the fc-webclient. If you want to specify a logical reader at runtime through the Logical Reader API you need to use a Dynamic Logical Reader.
Static Logical Reader Definitions are read/written by the Logical Reader Manager upon Filtering and Collection server deployment. They contain additional information for the Logical Reader Manager.
LogicalReaders act always either as a connector between software and hardware or as a connector between software and software. Therefor you need some parameters that configure your LogicalReader at your needs. In the following we will give a short introduction how you can setup the basic structure for a LogicalReader. You will find some elaborate Examples for real LogicalReaders later on in this guide (See Example1, Example2, Example3).
When you want to define your own LogicalReader through an xml-file you need to obey some restrictions. Some of them are discussed here.
example: <?xml version="1.0" encoding="UTF-8"?>
example: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns3:LRSpec xmlns:ns2="urn:epcglobal:ale:wsdl:1" xmlns:ns3="urn:epcglobal:ale:xsd:1"> </ns3:LRSpec>
example: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns3:LRSpec xmlns:ns2="urn:epcglobal:ale:wsdl:1" xmlns:ns3="urn:epcglobal:ale:xsd:1"> <isComposite>false</isComposite> </ns3:LRSpec>
example: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns3:LRSpec xmlns:ns2="urn:epcglobal:ale:wsdl:1" xmlns:ns3="urn:epcglobal:ale:xsd:1"> <isComposite>false</isComposite> <readers/> <properties> <property> <name>ReaderType</name> <value>org.fosstrak.ale.server.readers.hal.HALAdaptor</value> </property> </ns3:LRSpec>
example: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns3:LRSpec xmlns:ns2="urn:epcglobal:ale:wsdl:1" xmlns:ns3="urn:epcglobal:ale:xsd:1"> <isComposite>true</isComposite> <readers> <reader>LogicalReader1</reader> </readers> <properties> <property> <name>ReaderType</name> <value>org.fosstrak.ale.server.readers.CompositeReader</value> </property> </properties> </ns3:LRSpec>
example: <?xml version="1.0" encoding="UTF-8"?> <LogicalReaders xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="/resources/LogicalReaders.xsd"> </LogicalReaders>
example: <?xml version="1.0" encoding="UTF-8"?> <LogicalReaders xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="/resources/LogicalReaders.xsd"> <LogicalReader name="LogicalReader1"> <LRSpec isComposite="false" readerType="org.fosstrak.ale.server.readers.llrp.LLRPAdaptor"> </LRSpec> </LogicalReader> </LogicalReaders>
Make sure, that you use the name of a LogicalReader only once. The logical reader API does not allow duplicates of LogicalReaders.
To check your xml-file for correctness you can use our xsd schema (LogicalReaders.xsd).
In LLRP the reader needs special arameters for the connection between the physical reader and the LogicalReader. For a detailed introduction of these parameters refer to the developers-guide - section "Implement an Adaptor".
The Example shows the definition of one LLRP LogicalReader.
You can download the xml LLRPReader.xml.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns3:LRSpec xmlns:ns2="urn:epcglobal:ale:wsdl:1" xmlns:ns3="urn:epcglobal:ale:xsd:1"> <isComposite>false</isComposite> <readers/> <properties> <property> <name>ReaderType</name> <value>org.fosstrak.ale.server.readers.llrp.LLRPAdaptor</value> </property> <property> <name>Description</name> <value>LLRP reader</value> </property> <property> <name>PhysicalReaderName</name> <value>LogicalReader1</value> </property> <property> <name>ip</name> <value>localhost</value> </property> <property> <name>port</name> <value>5084</value> </property> <property> <name>clientInitiated</name> <value>true</value> </property> </properties> </ns3:LRSpec>
You can download the xml users-guide-example1.xml.
<?xml version="1.0" encoding="UTF-8"?> <LogicalReaders xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="/resources/LogicalReaders.xsd"> <LogicalReader name="LogicalReader1"> <LRSpec isComposite="false" readerType="org.fosstrak.ale.server.readers.llrp.LLRPAdaptor"> <LRProperty name="Description" value="LLRP reader"/> <LRProperty name="PhysicalReaderName" value="LogicalReader1"/> <LRProperty name="ip" value="localhost"/> <LRProperty name="port" value="5084"/> <LRProperty name="AdaptorClass" value="LLRPReader"/> <LRProperty name="ImplClass" value="org.fosstrak.ale.server.readers.llrp.LLRPAdaptor"/> <LRProperty name="clientInitiated" value="true"/> </LRSpec> </LogicalReader> </LogicalReaders>
In the Hardware Abstraction Layer (HAL) the reader needs special parameters for the bootstrapping of the HAL. For a detailed introduction of these parameters refer to the developers-guide - section "Implement an Adaptor".
The Example shows the definition of one HAL LogicalReader.
You can download the xml HALReader.xml.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns3:LRSpec xmlns:ns2="urn:epcglobal:ale:wsdl:1" xmlns:ns3="urn:epcglobal:ale:xsd:1"> <isComposite>false</isComposite> <readers/> <properties> <property> <name>ReaderType</name> <value>org.fosstrak.ale.server.readers.hal.HALAdaptor</value> </property> <property> <name>Description</name> <value>My first HAL device reader</value> </property> <property> <name>PhysicalReaderName</name> <value>MyReader1</value> </property> <property> <name>ReadTimeInterval</name> <value>1000</value> </property> <property> <name>PropertiesFile</name> <value>/props/SimulatorController.xml</value> </property> </properties> </ns3:LRSpec>
You can download the xml users-guide-example2.xml.
<?xml version="1.0" encoding="UTF-8"?> <LogicalReaders xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="/resources/LogicalReaders.xsd"> <LogicalReader name="LogicalReader1"> <LRSpec isComposite="false" readerType="org.fosstrak.ale.server.readers.hal.HALAdaptor"> <LRProperty name="Description" value="My first HAL device reader"/> <LRProperty name="AdaptorClass" value="HAL"/> <LRProperty name="PhysicalReaderName" value="MyReader"/> <LRProperty name="ReadTimeInterval" value="1000"/> <LRProperty name="ReadPoints" value="Shelf1,Shelf2"/> <LRProperty name="PropertiesFile" value="/props/SimulatorController.xml"/> </LRSpec> </LogicalReader> </LogicalReaders>
The following Example introduces the capability of the logical reader API to combine several readers into one CompositeReader. This CompositeReader then again can be used as a LogicalReader. This even enables that CompositeReaders can be used again in other CompositeReaders.
This Example shows one HAL reader and one RP reader that then will be part of one CompositeReader.
Make sure that you defined the two readers "LogicalReader1" and "LogicalReader2" in advance. Otherwise the creation of the composite reader will fail!
You can download the xml CompositeReader1.xml.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns3:LRSpec xmlns:ns2="urn:epcglobal:ale:wsdl:1" xmlns:ns3="urn:epcglobal:ale:xsd:1"> <isComposite>true</isComposite> <readers> <reader>LogicalReader1</reader> <reader>LogicalReader2</reader> </readers> <properties> <property> <name>ReaderType</name> <value>org.fosstrak.ale.server.readers.CompositeReader</value> </property> </properties> </ns3:LRSpec>
You can download the xml users-guide-example3.xml.
<?xml version="1.0" encoding="UTF-8"?> <LogicalReaders xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="/resources/LogicalReaders.xsd"> <LogicalReader name="LogicalReader1"> <LRSpec isComposite="false" readerType="org.fosstrak.ale.server.readers.llrp.LLRPAdaptor"> <LRProperty name="Description" value="LLRP reader"/> <LRProperty name="PhysicalReaderName" value="LogicalReader1"/> <LRProperty name="ip" value="localhost"/> <LRProperty name="port" value="5084"/> <LRProperty name="AdaptorClass" value="LLRPReader"/> <LRProperty name="ImplClass" value="org.fosstrak.ale.server.readers.llrp.LLRPAdaptor"/> <LRProperty name="clientInitiated" value="true"/> </LRSpec> </LogicalReader> <LogicalReader name="LogicalReader2"> <LRSpec isComposite="false" readerType="org.fosstrak.ale.server.readers.hal.HALAdaptor"> <LRProperty name="Description" value="My first HAL device reader"/> <LRProperty name="AdaptorClass" value="HAL"/> <LRProperty name="ImplClass" value="org.fosstrak.ale.server.readers.hal.HALAdaptor"/> <LRProperty name="PhysicalReaderName" value="MyReader"/> <LRProperty name="ReadTimeInterval" value="1000"/> <LRProperty name="PropertiesFile" value="/props/SimulatorController.xml"/> </LRSpec> </LogicalReader> <LogicalReader name="CompositeReader1"> <LRSpec isComposite="true" readerType="org.fosstrak.ale.server.readers.CompositeReader"> <LRProperty name="Description" value="My first composite reader consisting of LogicalReader1 and LogicalReader2"/> <readers>LogicalReader1</readers> <readers>LogicalReader2</readers> </LRSpec> </LogicalReader> </LogicalReaders>