Developer Guide

About this Guide

This guide is intended for developers who wish to work on Fosstrak HAL Implementations. It outlines the steps to follow for setting up the development environment and helps developers to find their way through the code.

Getting Started

This section describes the setup of the development environment we use when working on Fosstrak's HAL project. To compile the HAL, simply execute Maven. A Java Development Kit needs to be installed.

SVN Checkout

First thing you need to do is checking out the code from the SVN repository. See the Source Repository section on how to access the sources.

Installing Maven

We use Maven 2 as our build tool. After installation you need to have the M2_HOME environment variable set to your Maven installation directory.

Installing Java Communications API

The FEIG OBID i-scan ID.ISC MR101-A implementation needs the Java Communications API to compile successfully and communicate with the reader. Instructions on installing the Java Communications API can be found in the Feig User Guide.

Project Layout

This section helps developers to find their way through the code.

Project Modules

Fosstrak's HAL project consists of multiple modules. Currently, it includes four modules:

  • hal-commons

    This module contains the HardwareAbstraction interface definition and common functionality such as exceptions, descriptors, models, types and utility classes.

  • hal-impl-sim

    This module provides simulators implementing the HardwareAbstraction interface. Each simulator can be used in exactly the same way as an implementation for a hardware reader. Following simulator types are available:

    • The Graphic Simulator shows a GUI with representations of a reader and antennas. Tags can be created and draged over an antenna. The memory of a tag can be read and written manually in the GUI.
    • The Batch Simulator takes a file containing information about which tag does enter or exit an antenna on what time.
    • The Command Line Simulator opens a prompt and the user can add and remove tags textually and interactively.
    • The Multi Simulator consists of a client implementing the HardwareAbstraction interface and connecting to a server through TCP/IP. The server can run on an other computer and starts a graphic, batch or command line simulator. The events generated by the simulator are sent to the client.
  • hal-impl-impinj

    This module implements the HardwareAbstraction interface for the Impinj Speedway reader. The controller communicates with the reader through TCP/IP and the Impinj Mach1 protocol.

  • hal-impl-feig

    This module contains two controllers for readers from FEIG ELECTRONIC:

    • The FeigCOMController implements the HardwareAbstraction for the FEIG ELECTRONIC OBID i-scan ID ISC.MR100/101 reader with possibility to use FEIG ELECTRONIC OBID i-scan ID ISC.ANT.MUX multiplexers for attaching multiple antennas to one reader. Communication with the reader is done through a COM port which require the Java Communications API to be installed.
    • The FeigTCPIPController communicates to the FEIG ELECTRONIC OBID i-scan ID ISC.LRU1000 reader over TCP/IP. The reader has a built-in multiplexer to attach four antennas to the reader.

Directory Layout

We use the standard Maven directory layout as follows:

|
+-- pom.xml                             -> top-level POM file
|
+-- LICENSE.txt, README.txt
|
+-- src/
|   |
|   `-- site/                           -> project documentation
|
+-- hal-commons/
|   ¦
|   '
|
+-- hal-impl-impinj/
|   ¦
|   '
|
+-- hal-impl-feig/
|   ¦
|   '
|
+-- hal-impl-sim/
|   |
|   +-- pom.xml                         -> module POM file
|   |
|   `-- src/
|       |
|       +-- main/
|       |   |
|       |   +-- java/                   -> java source files
|       |   |
|       |   +-- resources/              -> configuration files and images
|       |   |
|       |   `-- assembly/               -> packaging information
|       |
|       +-- site/                       -> module documentation
|       |
|       `-- test/
|           |
|           `-- java/                   -> java unit test source files
|
`-- target/                             -> generated contents

Using Maven

We use Maven as our build tool for the Fosstrak HAL project.

Building

For building the sources, it is sufficient to run the following command:

mvn compile

Eclipse Integration

In order to work on the Fosstrak HAL using Eclipse, follow these instructions:

  1. Eclipse needs to know the path to the local maven repository. Execute the following command to automatically set up the corresponding classpath variable M2_REPO accordingly:
    mvn -Declipse.workspace=<path-to-eclipse-workspace> eclipse:add-maven-repo
    
  2. In order to generate the .project and .classpath file used by Eclipse, execute the following command from the directory containing the Fosstrak HAL source code:
    mvn eclipse:eclipse
    
  3. Inside Eclipse, import all the sub-modules (from the menu bar, select File > Import > Existing Projects into Workspace).

Generation of Binaries

The following command will generate the binaries for the modules.

mvn package

Installing

To install Fosstrak HAL in the local Maven repository and use it in other projects, for instance Fosstrak Reader, run the following command:

mvn install

Site Generation

The main web site (containing this documentation) can be generated by using the following command:

mvn site -N

In order to generate all module reports and to test the whole site navigation before a live deploy, you can execute the following command which will generate the web site under the given directory:

mvn site:stage -DstagingDirectory=<directory-to-deploy-site>