Overview

Architecture

Customer applications communicate with the Indy Modules using the Impinj Radio Interface (IRI) API. Details of the IRI API are defined in the iri.h header file and includes functions, structures, defines, and report handlers.

The IRI library also exposes a platform interface, see platform.h. The platform interface provides functions to open and close the serial port, read and write the serial port. Platform interface also provides functions to generate timetamps and sleep. Source code examples for the platform implementation are provided for Windows, Linux and OSX. Customers can use the example source code or write their own to port to a new platform.

../images/IRI_drawing.png

IRI Communication Model

At power-up, or following a reset, the Host communicates synchronously with the Indy Module. The Host sends a command to the Indy Module and the Indy Module sends a response to the Host. All of the IRI API functions that require communication with the Indy Module follow this standard, synchronous protocol (ipj_reset, ipj_set, ipj_set_value, ipj_bulk_set, ipj_get, ipj_get_value, ipj_bulk_get, ipj_start, and ipj_stop).

After the IRI host calls ipj_start, the Indy Module transitions to an asynchronous communication protocol. The Indy Module generates reports when certain events occur (e.g. Tag Operation Reports when Tags are Inventoried, Stop Reports when Inventory stops, GPIO Reports when GPIO status changes, or Error Reports when errors are detected). The IRI host is responsible for calling ipj_receive to retrieve the reports generated by the Indy Module. The IRI host is also responsible for providing a report handler to process the reports. The Indy Module will issue a Stop Report before transitioning back to the standard, synchronous protocol. The Indy Module may generate reports after a stop command has been issued and the corresponding response received. The IRI host is responsible for calling ipj_receive until the Stop Report is received.

Typical Host Application Elements

IRI_Intro is a simple Host application. IRI_Intro uses the elements of a typical Host application shown below:

  1. Allocate or declare IRI device

  2. Initialize IRI device structure

  3. Connect to IRI device

  4. Register platform handlers

    • Platform open handler
    • Platform close handler
    • Platform transmit handler
    • Platform receive handler
    • Platform timestamp handler
    • Platform sleep handler
  5. Register report handler

  6. Configure the Indy Module

  7. Start inventory

  8. While running inventory

  9. Stop inventory

    • Call ipj_receive to process incoming reports
    • Stop when stop report received, indicating that the Indy Module has stopped inventory
  10. Disconnect from IRI device

  11. De-initialize IRI device structure

IRI API functions that transmit commands to the Indy Module wait for a response from the Indy Module before returning (e.g. ipj_reset, ipj_set, ipj_set_value, ipj_bulk_set, ipj_get, ipj_get_value, ipj_bulk_get, ipj_start, and ipj_stop).

While Inventory is running the Indy Module generates tag operation reports for each tag that is inventoried. The Host application calls ipj_receive to process the incoming tag operation reports. The ipj_receive function processes the data available from the serial driver, calls the report handler upon detecting a complete report, and returns. The ipj_receive function does not wait for incoming report data. The Host application provides a report handler function to process the incoming tag operation reports.

ITK-C Directory Structure

Source code is provided for the IRI library and example applications to enable users to port the IRI library.

Library

  • New projects need to include all of the \*.h and \*.c files located within ITK_C/Library directory
  • As an exception to the rule above, only one platform_*.c need be included
  • A PORTING.txt file has been provided with brief porting instructions
  • A platform_empty.c file has been provided with a stubbed out API to quickly enable a porting effort

IRI library source code contents:

ITK_C\Library\config.h
ITK_C\Library\iri.c
ITK_C\Library\iri.h
ITK_C\Library\platform.h
ITK_C\Library\platform_empty.c
ITK_C\Library\platform_linux.c
ITK_C\Library\platform_osx.c
ITK_C\Library\platform_win32.c
ITK_C\Library\PORTING.txt
ITK_C\Library\version.h
ITK_C\Library\Nanopb\pb.h
ITK_C\Library\Nanopb\pb_decode.c
ITK_C\Library\Nanopb\pb_decode.h
ITK_C\Library\Nanopb\pb_encode.c
ITK_C\Library\Nanopb\pb_encode.h
ITK_C\Library\PbMessages\commands.pb.c
ITK_C\Library\PbMessages\commands.pb.h
ITK_C\Library\PbMessages\enums.pb.h
ITK_C\Library\PbMessages\error_codes.pb.h
ITK_C\Library\PbMessages\key_codes.pb.h
ITK_C\Library\PbMessages\messages.pb.c
ITK_C\Library\PbMessages\messages.pb.h
ITK_C\Library\PbMessages\packet.pb.c
ITK_C\Library\PbMessages\packet.pb.h

Examples

  • Example applications (all IRI_*.c files) are provided with build systems for the following environments:
    • Makefile for GNU based systems (Linux, Cygwin, etc.)
    • Visual Studio solutions for MSVC 2005 and MSVC 2012.
  • The Visual Studio solutions contain:
    • A README.txt containing instructions on how to create a new IRI example project
    • An IRI_Empty project that is already set up as a placeholder to quickly try out customized IRI commands.
  • An ipj_util project is provided that contains functions common across the examples

Examples source code contents:

ITK_C\Examples\ipj_util.c
ITK_C\Examples\ipj_util.h
ITK_C\Examples\IRI_Access.c
ITK_C\Examples\IRI_Antenna_Descriptors.c
ITK_C\Examples\IRI_Change_Baudrate.c
ITK_C\Examples\IRI_Empty.c
ITK_C\Examples\IRI_External_Antenna_Mux.c
ITK_C\Examples\IRI_GPIO.c
ITK_C\Examples\IRI_Intro.c
ITK_C\Examples\IRI_Loader.c
ITK_C\Examples\IRI_Multiple_Readers.c
ITK_C\Examples\IRI_Power_Management.c
ITK_C\Examples\IRI_Select.c
ITK_C\Examples\IRI_Test_CW_PRBS.c
ITK_C\Examples\Makefile
ITK_C\Examples\VS2005\Examples.sln
ITK_C\Examples\VS2005\README.txt
ITK_C\Examples\VS2005\stdbool.h
ITK_C\Examples\VS2005\stdint.h
ITK_C\Examples\VS2012\Examples.sln
ITK_C\Examples\VS2012\README.txt
ITK_C\Examples\VS2012\stdbool.h