Attachment_0007_DoD Table Manager Module Developers Guide.docx

DOCX document 2 MB Posted

Attached to
aRFID-V
Solicitation number
W52P1J-20-R-0044
Issued by

About this file

This is a solicitation for an active radio frequency identification hardware, software, documentation, and technical engineering services contract. The Army Contracting Command-Rock Island has a requirement for a follow-on to the current aRFID-IV contract that expires on July 7, 2020. The new aRFID-V contract is a non-competitive procurement issued to Savi Technology, Inc.; however, all responsible sources may submit a capability statement, proposal, or quotation for consideration. The federal agency involved is the Department of the Army Materiel Command Joint Munitions Command. The incumbent is Savi Technology, Inc.

View the file

Other files

File Type Posted
Attachment_0015_aRFID_ITV_Server_Interface_Document.pdf PDF
Attachment_0019_ Non Disclosure Agreement.pdf PDF
Copy of Attachment_0018_Price Matrix.xlsx XLSX spreadsheet
Attachment_0006_Description of DoD Table Manager Module (TMM).docx DOCX document
Attachment_0003_DoD Transponder Hardwire Electrical Interface and Data P....docx DOCX document
Attachment_0013_JD TAV 2_5 RF Tag Format Version 2 5 (ISO Tables).docx DOCX document
Attachment_0017_PWS RFID-V 14 2020-05-26.pdf PDF
Attachment_0005_DoD Interoperability Guidelines for the Over Air Interfa....docx DOCX document
Attachment_0016_Standard Cables and Connectors for Active Fixed Interrog....docx DOCX document
Attachment_0008_DoD Active RFID Common Abstraction Interface Developers ....docx DOCX document
Attachment_0002_DoD Transponder Barcode Labeling Guidelines.docx DOCX document
Attachment_0001_DoD Over Air Interface Guidelines.docx DOCX document
Attachment_0012_aRFID V Software Functional Requirements.docx DOCX document
B08. W52P1J-20-R-0044.pdf PDF
Attachment_0009_DoD Active RFID Common Abstraction Interface Developers ....pdf PDF
Attachment_0014_Post Award Product Testing Process.docx DOCX document
Attachment_0011_DoD Transponder Battery Guidelines.docx DOCX document
Attachment_0010_DoD Routing Code Guidelines.docx DOCX document
A03. Attachment 0020 - aRFIDV CDRLs clean.docx DOCX document
Attachment_0004_Description of DoD ISO-18000-7 Hardwire Reference Driver....docx DOCX document
Show all 20

On GovTribe

Work with this file

  • Download the original file
  • Contacts named in this file
  • Similar government files
  • Ask GovTribe AI about this file

Text version

ISO 18000-7 RFID Developer Guide Table Manager Module API Version 2.0.2

[Type the abstract of the document here. The abstract is typically a short summary of the contents of the document. Type the abstract of the document here. The abstract is typically a short summary of the contents of the document.]

Published October 2008

Part number 260-04227-001 Rev. C

Documentation for Table Manager Module API, version 1.2.4

Information in this guide is subject to change without notice and does not represent a commitment from the Government.

Address comments to: PM J-AIT 8580 Cinder Bed Road Suite 1400 Newington, VA 22122

Contents

Chapter 1 : About the Table Manager Module API8
How the Table Manager Module API Works8
How the Table Manager Module API Works with the CAI API and FDF API9
Supported RFID Devices10
TAV Data Format and Layout10
Tag Data Format10
Tag Data Layout13
Sensor Configuration File Data Format and Layout14
TAV Business and Data Validation Rules14
Data Content Validation14
Data Completeness Validation15
Loading TAV v. 2.0 Data from a File16
Writing TAV v. 2.5 Data to a Tag17
Saving TAV Data to a File Across TAV Versions18
Truncation Rules18
Miscellaneous Rules19
Sensor Configuration File Business and Data Validation Rules19
Other Information Resources19
Chapter 2 : Using the Table Manager Module API20
Accessing a Device20
Creating a TAV Object21
How to: Create a TAV Asset Object21
Code Example: Creating a TAV Asset Object23
How to: Create a TAV Sustainment Object29
Code Example: Creating a TAV Sustainment Object32
How to: Create a TAV Unit Move Object39
Code Example: Creating a TAV Unit Move Object42
Erasing Tags50
How to: Erase Data from a Tag50
Code Example: Erasing Data from a Tag51
Writing TAV Data55
How to: Write TAV Data from a File to a Tag55
How to: Write TAV Data to a License Plate Tag56
Code Example: Writing TAV Data from a File to an57
ISO Tag57
Reading TAV Data62
How to: Read TAV Data from a Tag and Save it to a File63
Code Example: Reading TAV Data from a Tag and64
Saving it to a File64
Code Example: Saving an Object to a Flat File in the Same Data Format69
Code Example: Saving an Object to a Flat File in a75
Different Data Format75
Querying Tags81
How to: Perform and Execute a Query Setup81
Code Example: Building and Executing a Query83
Using TAV Data90
How to: Get Sustainment Data from a Tag90
Code Example: Getting Sustainment Data from a94
Tag94
How to: Get Unit Move Data from a Tag102
Code Example: Getting Unit Move Data from a Tag107
How to: Get Asset Data from a Tag115
Code Example: Getting Asset Data from a Tag118
Testing TAV Data Truncation125
How to: Test Data Truncation125
Code Example: Testing Data Truncation127
TAV Data Validation132
How to: Validate Data in a TAV Object133
Code Example: Validating Data in a TAV Object136
Discovering Type of Data on a Tag140
Code Example: Discovering Tag Data Type140
Loading a Configuration File and Configuring a Sensing Transponder145
Loading a Recovery File and Recovering a Sensing Transponder145
Sending Contol Commands to a Sensing Transponder145
Reading Sensing Transponder Status145
Reading Sensing Transponder Events145
Reading Sensing Transponder Data Log145
Reading Sensing Transponder Current Sensor Values145
Chapter 3 : Testing and Distributing Table Manager Module Applications147
Table Manager Module in Desktop147
Environment147
Setting Up the Build Environment147
Testing the Application147
Distributing the Application148
Table Manager Module in Mobile148
Environment148
Setting Up the Build Environment148
Testing the Application149
Distributing the Application150
Chapter 4 : Managing Errors152
Specifying Exceptions152
Communication Exception152
Formatter Exception153
Query Exception153
Troubleshooting Using the TMLogger153
How to: Configure TMLogger153
Reading TMLogger Logs154
Error Messages155
Compatible Source and Target File Types160
Appendix B : Detailed Table Manager Module API Architecture161
Table Manager Module Interface Design161
Main Packages162
Format.tav Package162
formatter Package163
query Package164
exception Package165
util Package165
Appendix C : Text File Data Formats and Layouts167
TIPS-Write Sustainment Data Format, Version 1.0167
License Plate Header Section167
Commodity Section170
TCMD Section Format171
TIPS-Write Sustainment Data Format, Version 2.0171
LPDATA-EXTRA171
Unit Move, Version 2.0173
“Commodity Item” Records176
TCMD Section Format177
JDTAV v. 2.5 Text File Layouts178
Asset Data Text File Layout178
Sustainment Data Text File Layout180
Unit Move Data Text File Layout182
Appendix D : Data Elements, Data Values, and Data Truncation Rules187
Asset Type Data Elements187
Data Values and Truncation Rules188
Query Data Elements Mapping193
Appendix E : File Samples197
JDTAV v. 2.5 Import Files197
Example: Asset Data197
Example: Sustainment Data197
Example: Unit Move Data200
TIPS Write v. 2.0 Import Files201
TIPS Write v. 1.0 Import Files203
Unit Move v. 2.0 Import Files207
Savi Sustainment v. 2.0 Import Files209
Chapter 1 : About the Table Manager Module API7
How the Table Manager Module API Works7
How the Table Manager Module API Works with the CAI API and FDF API8
Supported RFID Devices9
Data Format and Layout9
Tag Data Format9
Tag Data Layout12
Business and Data Validation Rules13
Data Content Validation13
Data Completeness Validation14
Loading TAV v. 2.0 Data from a File15
Writing TAV v. 2.5 Data to a Tag16
Saving TAV Data to a File Across TAV Versions17
Truncation Rules17
Miscellaneous Rules18
Other Information Resources18
Chapter 2 : Using the Table Manager Module API19
Accessing a Device19
Creating a TAV Object19
How to: Create a TAV Asset Object20
Code Example: Creating a TAV Asset Object22
How to: Create a TAV Sustainment Object28
Code Example: Creating a TAV Sustainment Object31
How to: Create a TAV Unit Move Object38
Code Example: Creating a TAV Unit Move Object41
Erasing Tags49
How to: Erase Data from a Tag49
Code Example: Erasing Data from a Tag49
Writing TAV Data54
How to: Write TAV Data from a File to a Tag54
How to: Write TAV Data to a License Plate Tag55
Code Example: Writing TAV Data from a File to an56
ISO Tag56
Reading TAV Data61
How to: Read TAV Data from a Tag and Save it to a File61
Code Example: Reading TAV Data from a Tag and62
Saving it to a File62
Code Example: Saving an Object to a Flat File in the Same Data Format67
Code Example: Saving an Object to a Flat File in a74
Different Data Format74
Querying Tags80
How to: Perform and Execute a Query Setup80
Code Example: Building and Executing a Query82
Using TAV Data88
How to: Get Sustainment Data from a Tag88
Code Example: Getting Sustainment Data from a93
Tag93
How to: Get Unit Move Data from a Tag101
Code Example: Getting Unit Move Data from a Tag105
How to: Get Asset Data from a Tag114
Code Example: Getting Asset Data from a Tag117
Testing TAV Data Truncation124
How to: Test Data Truncation124
Code Example: Testing Data Truncation126
TAV Data Validation131
How to: Validate Data in a TAV Object131
Code Example: Validating Data in a TAV Object134
Discovering Type of Data on a Tag138
Code Example: Discovering Tag Data Type138
Chapter 3 : Testing and Distributing Table Manager Module Applications145
Table Manager Module in Desktop145
Environment145
Setting Up the Build Environment145
Testing the Application145
Distributing the Application146
Table Manager Module in Mobile146
Environment146
Setting Up the Build Environment146
Testing the Application147
Distributing the Application148
Chapter 4 : Managing Errors150
Specifying Exceptions150
Communication Exception150
Formatter Exception151
Query Exception151
Troubleshooting Using the TMLogger151
How to: Configure TMLogger151
Reading TMLogger Logs152
Error Messages153
Compatible Source and Target File Types158
Appendix A : Detailed Table Manager Module API Architecture159
Table Manager Module Interface159
Design159
Main Packages160
Format.tav Package160
formatter Package161
query Package162
exception Package163
util Package163
Appendix B : Text File Data Formats and Layouts165
TIPS-Write Sustainment Data Format, Version 1.0165
License Plate Header Section165
Commodity Section168
TCMD Section Format169
TIPS-Write Sustainment Data Format, Version 2.0169
LPDATA-EXTRA169
Unit Move, Version 2.0171
“Commodity Item” Records174
TCMD Section Format175
JDTAV v. 2.5 Text File Layouts176
Asset Data Text File Layout176
Sustainment Data Text File Layout178
Unit Move Data Text File Layout180
Appendix C : Data Elements, Data Values, and Data Truncation Rules185
Asset Type Data Elements185
Data Values and Truncation Rules186
Query Data Elements Mapping191
Appendix D : File Samples195
JDTAV v. 2.5 Import Files195
Example: Asset Data195
Example: Sustainment Data195
Example: Unit Move Data198
TIPS Write v. 2.0 Import Files199
TIPS Write v. 1.0 Import Files201
Unit Move v. 2.0 Import Files205
Savi Sustainment v. 2.0 Import Files207

Chapter 1 : About the Table Manager Module API

This chapter discusses:

◆ “How the Table Manager Module API Works” on page 7 ◆ “Supported RFID Devices” on page 9 ◆ “Data Format and Layout” on page 9 ◆ “Business and Data Validation Rules” on page 13 ◆ “Other Information Resources” on page 18

Note: This chapter includes general information about the Common Abstraction Interface (CAI) API and the Savi SmartChain Device Framework (FDF) API. Refer to the corresponding product documentation for in-depth information.

How the Table Manager Module API Works The Department of Defense (DoD) uses active Radio Frequency Identification (RFID) technology to track international shipments and their contents. One method is to affix RFID tags to shipping containers. RFID readers determine the container’s location and track movement of the container and its contents. Existing active RFID tags (also known as legacy tags) are based on the ANSI INCITS 256 standards and tag data formats are based on the Joint Defense Total Asset Visibility (JDTAV) v. 2.0 standards. The DoD is transitioning existing ANSI INCITS 256 tags to tags using the ISO/IEC 18000-7 standard and data formats to a modified JDTAV v. 2.5 specification.

The DoD requires that existing RFID tags and readers be interoperable with the newer tags based on the ISO standards. The Table Manager Module API (TMM) is a Java-based software library for desktop and mobile platforms that standardizes the content and format of active RFID tag data used with DoD applications. The government provides TMM to automated information system (AIS) developers writing applications that perform read, write, sensor configuration, and query functions. Using TMM to develop applications provides support for legacy and ISO/IEC 18000-7 tags and achieves interoperability among the following:

◆ ANSI INCITS 256 legacy tags and readers

◆ ISO/IEC 18000-7-based active RFID products from multiple vendors

◆ RFID products and DoD-developed applications

◆ RFID Sensor Transponder (ST) and Intrusion Detection Transponder (IDT) configurations

The TMM APIs provide a common interface and an abstraction for applications that need to perform read, write, or query operations with JDTAV data and tags using the ANSI INCITS 256 and ISO/IEC 18000-7 standards. Details such as memory offsets, table IDs, and data validations are abstracted by TMM so developers using its APIs are not required to know if a tag is based on the JDTAV v. 2.0 or v. 2.5 standard. TMM determines which data standard the tag is using and data is automatically written to the tag in the appropriate format. Data input can be an object or a flat file that TMM can parse. The DoD Sensor Interface files use a separate interface from the JDTAV file that is self contained and self identifying.

Tag collection and device management functions do not require TMM and must use vendor provided device drivers instead.

How the Table Manager Module API Works with the CAI API and FDF API

The CAI specification defines the API for RFID device drivers. Applications developed with the CAI API support RFID products from multiple vendors and are interoperable with RFID products used within the DoD’s RF in-transit visibility (ITV) network. TMM uses CAI supported device drivers to communicate with ISO/IEC 18000-7 tags and readers, and FDF API to communicate with legacy tags. The CAI API supports loading and using multiple vendor drivers simultaneously. The drivers must be configured according to the vendor and CAI documentation before using TMM.

ANSI INCITS 256 legacy tags and legacy tags upgraded with the ISO firmware require a FDF device driver for communication through docking station or serial connection.

Figure 1-1 demonstrates how edge applications use device drivers from RFID vendors and the DoD to manage devices and collect tag data either by using an RFID reader or by communicating directly with a tag over the wire. TMM uses the same device drivers for tag read, write, and query operations using an RFID reader or direct tag communication. ANSI INCITS 256 legacy tags or legacy tags upgraded with ISO firmware allow for direct communication using a proprietary serial connection protocol.

Figure 1

Supported RFID Devices ◆ Legacy ANSI INCITS 256 tags (except ST412) ◆ Legacy tags updated to ISO/IEC 18000-7 specification ◆ Legacy readers updated to ISO/IEC 18000-7 specification ◆ Docking Station ◆ Tag Write Cable ◆ USB Write Cable ◆ ISO/IEC 18000-7 tags ◆ ISO/IEC 18000-7 readers TAV Data Format and Layout Standardized data formats provide a means of storing, accessing and transferring information with active RFID tags. TMM uses the JDTAV v. 2.5 (ISO) RF tag data specification to format and store Sustainment, Unit Move, and Asset data on ISO/IEC 18000-7 tags. The JDTAV v. 2.0 (ANSI INCITS) data format specification is used for formatting and storing data on legacy tags. See Appendix B, “Text File Data Formats and Layouts”.

Tag Data Format

TMM supports three data formats required for DoD ITV and asset management applications:

◆ Sustainment: Stores manifests, Transportation Control and Movement Document (TCMD) transactions, and shipment content level detail. Data written to the tag by the supplier supports both the shipper and receiver. For ammunition and pre-positioned cargo shipments, the Sustainment format is modified to accommodate specific information requirements.

◆ Unit Move: Stores data identifying material, containers, rolling stock, and individual end items. This data supports movement of these items from a garrison location through staging locations to a tactical location.

◆ Asset: Records information about the tagged item. This is a placeholder for software developers until Asset tag procedures are approved and published in DoD regulatory publications.

Figure 1-2 demonstrates the path each data type (Sustainment, Unit Move, Asset) follows as it moves through TMM.

◆ Write function: Black arrows traveling left to right ( ) show how data moves as it is imported from a file into TMM and is then written to a tag.

◆ Read function: Red arrows traveling right to left ( ) show how data moves as it is read from a tag into TMM and is then saved to a file.

Table 1-1 on page 11contains details the file format options when writing data to a tag.

Table 1-2 on page 12 details the file format options when saving data read from a tag.

Table 1-1 Imported File Format Options for Writing Data to a Tag

Source
Destination

Imported File Data Type

Legacy (ANSI INCITS 256) Tags
ISO/IEC 18000-7 Tags
Sustainment
Unit Move
Asset
Sustainment
Unit Move
Asset
TIPS Write Sustainment (v. 1.0)
Yes

Yes

TIPS Write Sustainment (v. 2.0)
Yes

Yes

Unit Move v. 2.0

Yes

Yes

Savi Sustainment v. 2.0
Yes

Yes

JDTAV v. 2.5 Sustainment
Yes

Yes

JDTAV v. 2.5 Unit Move

Yes

Yes

JDTAV v. 2.5 Asset

Yes

Yes

Table 1-2 File format options for saving data read from a tag

Source
Destination
Legacy (ANSI INCITS 256) Tags
ISO/IEC 18000-7 Tags
Sustainment
Unit Move
Asset
Sustainment
Unit Move
Asset
File Format Types

Yes

TIPS Write Sustainment (v. 1.0) TIPS Write Sustainment (v. 2.0) JDTAV v. 2.5 (ISO) Sustainment

Yes

TIPS Write Sustainment (v. 1.0) TIPS Write Sustainment (v. 2.0) JDTAV v. 2.5 (ISO) Sustainment

Yes

Unit Move v. 2.0 JDTAV v. 2.5 (ISO) Unit Move

Yes

Unit Move v2.0 JDTAV v. 2.5 (ISO) Unit Move

Yes

JDTAV v. 2.5 (ISO) Asset

Yes
JDTAV v. 2.5 (ISO) Asset

Tag Data Layout

JDTAV v. 2.0 Data Layout on Legacy Tags

TMM uses the JDTAV v. 2.0 data specification to format and store Sustainment and Unit Move data on legacy tags. Data is stored in memory, in a flat file. The data layout is the same in memory and the flat file.

Three data types are used:

◆ Tav summary ◆ Commodity (database)

◆ TCMD

JDTAV v. 2.5 Data Layout on ISO/IEC 18000-7 Tags

TMM uses the JDTAV v. 2.5 (ISO) RF tag data specification to format and store Sustainment, Unit Move, and Asset data on ISO/IEC 18000-7 tags. ISO/IEC 18000-7-compatible tags require that all data be written to one or more tables to use the table query commands. Each of ISO protocol table is technically limited to 65,535 records and each record can have up to 32 fields with up to 255 characters in each field.

To achieve compatibility with the legacy JDTAV v. 2.0 format, four data types are stored in ISO searchable tables:

◆ Total Asset Visibility (TAV) ◆ Commodity

◆ TCMD

◆ User Defined

File Format Options

The file format options are separate from the JDTAV v. 2.0 and v. 2.5 data specifications.

The import data file provides a standard ASCII file-based mechanism of transferring shipment and asset data from external systems into TMM as source data for writing to tags. Applications can also supply shipment and asset data to TMM using the object interface.

For backward compatibility, TMM supports the following legacy data file formats:

◆ TIPS Write Sustainment Format (v. 1.0)

◆ TIPS Write Sustainment Format (v. 2.0)

◆ Savi Sustainment Format (v. 2.0)

◆ Unit Move Format v. 2.0The JDTAV v. 2.5 (ISO) data file format specification is also supported. These file formats are available in Appendix B, “Text File Data Formats and Layouts”.

Sensor Configuration File Data Format and Layout For details on the sensor configuration file format and layout please see the DoD Sensor Interface Guidelines Appendix A. The current version of the TMM supports only version “1.0” of the configuration file format.

TAV Business and Data Validation Rules TMM performs data content and data completeness validation during loading, writing, and transferring TAV data. When data moves across TAV versions, such as from JDTAV v. 2.5 to v. 2.0, data can be lost because element definitions were enhanced in JDTAV v. 2.5. A property file is used to enforce data validation rules. For information about the data elements and data values/ranges, see Appendix C, “Data Elements, Data Values, and Truncation Rules.”

Data Content Validation

Data content is validated at the element level. Values contained in a data element must conform to the type/size rules defined in the JDTAV v. 2.0 and v. 2.5 specifications or in the definition of the sensor configuration files. The following is a summary of the JDTAV v. 2.5 general rules enforced by TMM. For detail, see Active RFID Tag Format and Data Specifications, Joint Defense Total Asset Visibility (JDTAV), Version 2.5 (ISO Tables), or DoD Sensor Interface Guidelines.

◆ Type/Size (bytes): Defines the element data structure as numeric (n), alphanumeric (an), or hexadecimal (hex); denotes a fixed or variable data structure; defines the field length in bytes. This information is contained in tables for the following:

❖ Fixed length alphanumeric data is annotated as (an), numeric data is annotated as (n).

❖ Variable length alphanumeric data is annotated as (an..), numeric data is annotated as (n..).

❖ The field size in bytes is annotated with a number. For example, (an..50) denotes variable length alphanumeric data in a fixed field length of 50 bytes. This field length must be defined for ISO/IEC 18000-7 commands.

◆ Value: Identifies the specific value or type of information in the field. Certain fields have pre-defined data values or ranges. For detail, see Table A-10, “Data Values or Ranges and Truncation Rules,” on page 209.

◆ Justification and padding: TMM implements justification and padding business rules as follows:

❖ Alphanumeric (an) fields are left justified and padded with trailing spaces.

❖ Numeric (n) fields are right-justified and padded with leading zeros as needed. This only applies to fixed numeric fields.

Data Completeness Validation

A minimum set of mandatory data elements is required to write TAV data to a tag. TMM performs data completeness validation to ensure that the following data elements are present.

◆ Sustainment ❖ Shipment ID ❖ Shipment ID Type ❖ Cargo Type (HAZMAT) Code ❖ Cube (Gross) ❖ Weight (Gross) ❖ Shipment Piece Count ◆ Unit Move ❖ Shipment ID ❖ Shipment ID Type ❖ Cargo Type (HAZMAT) Code ❖ Equipment Description ❖ Unit Identification Code (UIC) ❖ Unit Line Number (ULN) ◆ Asset ❖ Asset ID ❖ Asset Type (Container, Air Force Vehicle/Trailer, Air Force Equipment, Pallet): Mandatory minimum data elements are enforced according to the Asset Type. See Table A-9, “Asset Types (Prototype),” on page 207 for details.

Loading TAV v. 2.0 Data from a File

A TAV data object can be populated with data from a file and used to write Asset, Sustainment, or Unit Move data to a tag. The data file can either contain Single Data Item (SDI) records or not.

This section discusses the requirements for creating a TAV object TMM can use. For details and examples, refer to “Creating a TAV Object” on page 19.

Using a File with SDI Records

The JDTAV v. 2.0 specification defines 11 SDI elements, which are located after the Commodity records at the end of the file.

◆ POE

◆ POD

◆ SERVICE

◆ CONTAINER NUM

◆ COMM CLASS

◆ LEAD TCN

◆ OPERATION

◆ HAZMAT CODE

◆ HAZCLASS

◆ NEW

◆ CONSIGNEE

The data in some pre-defined SDI records can also exist in the TAV summary, but should not be duplicated in the TAV object. To avoid duplication, the TAV object definition is modified by TMM to contain variable declarations for common predefined SDI elements.

The common pre-defined SDI elements are initialized using the available data because the Tav summary is parsed first. Note the following exceptions:

◆ If the container number record (CONTAINER NUM) was defined in the Commodity Section, then the CONTAINER NUM data overwrites the predefined data when the SDI records are parsed.

◆ If the common elements are not populated when the TAV summary is parsed, then the predefined SDI values are used.

◆ If an undefined SDI element is detected while parsing, it is put into the User Defined section of the TAV object.

◆ If a TIPS Write TAV v. 2.0 Data File is used, the elements located in the #LPDATA-EXTRA# section are parsed and treated as SDI records (listed above).

Using a File without SDI Records

Data from the TAV summary section is used to create the SDI records, which are appended to the Commodity section on the tag when TAV data is written.

Writing TAV v. 2.5 Data to a Tag

This section discusses how TMM creates records with JDTAV v. 2.5 data and writes the data to a tag. For details and code examples, refer to “Writing TAV Data” on page 58.

Writing Sustainment or Unit Move Data to a Legacy Tag

In this case the data to be written to a legacy tag is based on JDTAV v. 2.0. To compensate for potential loss of data when moving across TAV versions, TMM does the following:

◆ Writing a Tav summary record

❖ For a Container Number data element, TMM takes the right five characters.

❖ Ship data is made to conform to the Julian format with a value less than 366.

◆ Writing a Commodity record

❖ If Ammo records exist in the TAV object, they are paired with the parent Commodity records following the JDTAV v. 2.0 specification and written to the tag.

❖ TMM creates SDI records using the data for the predefined SDI elements in the TAV object. For a list of pre-defined SDI elements, see “Using a File with SDI Records” on page 15. If a defined SDI element does not have a value, an SDI record will not be generated.

◆ User Defined records are appended as additional SDIs following the predefined ones.

◆ Asset Tag SDIs are different. For information, see the ST-614 Asset Data Format Specification and Application Specifications. Their values are added with MISC1 and MISC2 data elements so they can be used in query setup and search. The ST-614 Asset Data Format Specification defines the following SDIs:

❖ COMMAND

❖ ASSET ID

❖ ASSET TYPE

❖ MANAGER ORG

❖ LOT NUM

Writing Asset Data to a Legacy Tag

◆ In accordance with the ST-614 Asset Data Format Specification and Application Specifications, the data is converted to Unit Move format before writing it to the tag.

◆ If the Asset tag JDTAV v. 2.5 (ISO) elements are used to populate a JDTAV v. 2.1 (INCITS) Unit Move tag, the following elements are truncated: Asset Manager Org, Bumper Number, Equipment Description, and Serial Number. For more information, see Table A-10, “Data Values or Ranges and Truncation Rules,” on page 209.

Saving TAV Data to a File Across TAV Versions

This section discusses how TMM saves TAV data to a file in a different data format. For a code example, refer to “Code Example: Saving an Object to a Flat File in a Different Data Format” on page 81.

When saving TAV v. 2.5 Sustainment or Unit Move data to a file in TAV v. 2.0 format, TMM does the following:

◆ Tav summary

❖ Container Number: Takes the right 7 characters. It takes the full value for the CONTAINER NUM SDI record.

❖ Bumper Number: Drops 2 characters on the right.

❖ Equipment Description: Drops 12 characters on the right for Unit Move data.

❖ Free Text: Drops 27 characters on the right for a Unit Move tag. There is no loss for a Sustainment tag.

◆ Commodity

❖ Nomenclature: Drops 20 characters on the right.

❖ Quantity Shipped: Drops 2 digits. If the value must be truncated, TMM uses DTR Part II, Chapter 203 quantity coding logic to encode the value.

❖ Lot Number: Drops 1 character on the right when the Commodity record MISC2 field is populated.

❖ Lot/Serial Quantity: Drops 2 digits. If the value must be truncated, TMM uses DTR Part II, Chapter 203 quantity coding logic to encode the value.

◆ User Defined record data is populated as SDI records in the Commodity section, but truncated according to MISC1-14 and MISC2-16 size requirements.

Truncation Rules

SDI records are never truncated by TMM and are included in the memory calculations for mandatory data. TMM’s truncation algorithm accounts for SDI records that are created on the fly, for example when writing TAV v. 2.5 data to a legacy tag.

Memory Sizes Assumed for Tags

TMM assumes the following memory sizes for legacy tags:

◆ ST-410: 128K

◆ ST-654: 128K

◆ ST-614: 2K

TMM queries ISO tags to determine the user writable memory limit.

Miscellaneous Rules

◆ When parsing the value of an Ammo detail record, data located in the LIN element is interpreted as DOCIC.

◆ Lot/Serial Quantity Rules

Ammunition Lot/Serial Quantity records reflect either the quantity shipped of Lot numbered items or the quantity shipped of a Serial numbered item.

❖ If Lot Number data is encoded without a Serial Number, the Lot/Serial Quantity data element in the record is for the Lot Number.

❖ If a Serial Number is encoded, with or without a Lot Number, the Lot/ Serial Quantity data element in the record shows a quantity of "1" or "0000001".

Sensor Configuration File Business and Data Validation Rules For details on the sensor configuration file validation see the DoD Sensor Interface Guidelines Appendix A.

Other Information Resources For additional information about using the Table Manager Module, see the following publications:

◆ Table Manager Module API Reference (Javadocs) ◆ Table Manager Module, Technical Requirements and Design Specification ◆ Active RFID Tag Format and Data Specifications, Joint Defense Total Asset Visibility (JDTAV), Version 2.5 (ISO Tables) ◆ Active RFID Tag Format and Data Specifications, Joint Defense Total Asset Visibility (JDTAV), Version 2.0 (INCITS) ◆ TIPS Write Import Document, Version 1.0 ◆ Unit Move Version 2.0 Document ◆ DoD Sensor Interface Guidelines version 4.6 For these documents and additional information, refer to the RFID IIIV Statement of Work Attachments.

Chapter 2 : Using the Table Manager Module API This chapter discusses common functions used when developing an application with the Table Manager Module API. The code examples demonstrating these functions are also available in the gov.pmjait.tblmgr.samples package.

This chapter discusses in order:

◆ “Accessing a Device” on page 19 ◆ “Creating a TAV Object” on page 19 ◆ “Erasing Tags” on page 52 ◆ “Writing TAV Data” on page 58 ◆ “Reading TAV Data” on page 66 ◆ “Querying Tags” on page 88 ◆ “Using TAV Data” on page 98 ◆ “Testing TAV Data Truncation” on page 135 ◆ “TAV Data Validation” on page 143 ◆ “Discovering Type of Data on a Tag” ◆ “Loading a Configuration File and Configuring a Sensing Transponder” ◆ “Loading a Recovery File and Recovering a Sensing Transponder” ◆ “Sending Contol Commands to a Sensing Transponder” ◆ “Reading Sensing Transponder Status” ◆ “Reading Sensing Transponder Events” ◆ “Reading Sensing Transponder Data Log” ◆ “Reading Sensing Transponder Current Sensor Values”

Note: General information about the CAI API and FDF API is included to demonstrate how to use TMM. Refer to the corresponding product documentation for in-depth information about each API.

Accessing a Device Prior to using the TMM APIs, you must define and configure the necessary device drivers as described in the corresponding vendor documentation. For information, see the DoD RFID Common Abstraction Interface Developer’s Guide available in the RFID III Statement of Work Attachments.

Creating a TAV Object A TAV data object can be created manually, populated with data, and used when writing Asset, Sustainment, or Unit Move data to a tag.

Setting up a TAV Asset object generally follows this sequence:

◆ Instantiate a new TMAsset object using TMTavCreationHelper ◆ Set the data validation flag to false to turn validation on or to true to turn validation off ◆ Set values for Asset data members ◆ Create User Defined Record(s) ◆ Add User Defined Record(s) to the parent TMAsset object Setting up a TAV Sustainment or Unit Move object generally follows this sequence:

◆ Instantiate a new TMSustainment or TMUnitMove object using TMTavCreationHelper ◆ Set the data validation flag to false to turn validation on, or to true to turn validation off ◆ Set values for Tav summary data members ◆ Create a Commodity Record and set the values for data members. Include a unique sequence number when it is JDTAV 2.5 data.

◆ Create a Single Data Item Record for the pre-defined SDIs and set data values ◆ Add the Single Data Item Records to the parent Commodity ◆ Create a Lot Record and set the data values ◆ Create a Serial Record and set the data values ◆ Add Serial record(s) to the parent Lot ◆ Add Lot record(s) to the parent Commodity ◆ Add Commodity record(s) to the parent TMUnitMove/TMSustainment object ◆ Create a TCMD record ◆ Add TCMD record(s) to the parent TMUnitMove/TMSustainment object

How to: Create a TAV Asset Object

The code snippets are from the CreateTAVAssetObject.java file located in the gov.pmjait.tblmgr.samples package. Check that location for updates to the code.

The data values are included to demonstrate the process; refer to the JDTAV v. 2.0 and v. 2.5 specifications for further information.

Note: Steps 1 through 4 demonstrate how to create the object and steps 5 through 7 demonstrate how to write the data to a tag.

1. Import the required TMM Java classes and interfaces.

import gov.pmjait.tblmgr.format.tav.TMTavCreationHelper;

import gov.pmjait.tblmgr.format.tav.TMUserDefined; import gov.pmjait.tblmgr.formatter.TMFormatWriter; import gov.pmjait.tblmgr.formatter.TMFormatterFactory;

import gov.pmjait.tblmgr.formatter.TMFormatterFactoryHelper;

import gov.pmjait.tblmgr.formatter.TMTagTarget;

import gov.pmjait.tblmgr.formatter.TMTarget;

2. Identify the data format. This example demonstrates JDTAV v. 2.5. For JDTAV v. 2.0, substitute 2.0.

String version = TMTavCreationHelper.ValidTAVVersionNumbers.VER_02_05;

3. Instantiate a new TMAsset object using TMTavCreationHelper (this extends the TMFormat interface), enforce data validation, and set the data values for the asset.

TMAsset tavAsset = TMTavCreationHelper.getInstance().createNewAsset(version, false);

tavAsset.setAssetID("assetid"); tavAsset.setEquipmentDesc("assetdesc"); tavAsset.setAssetManagerOrganization("test"); tavAsset.setAssetManagerOrgType("S"); tavAsset.setAssetType("V-AF"); tavAsset.setBumperNumber("bumperno"); tavAsset.setCommand("Cmd"); tavAsset.setContainerNumber("ContNum"); tavAsset.setContainerSize("20"); tavAsset.setContainerType("2"); tavAsset.setContractNumber("ContractNo"); tavAsset.setDateOfManufacture("08082008"); tavAsset.setDateOfService("09092008"); tavAsset.setDetailNumber("DetailNo"); tavAsset.setIUID("ItemUniqueId"); tavAsset.setLeaseEndDate("09092010"); tavAsset.setLotNumber("lotno");; tavAsset.setManagementCode("mgt"); tavAsset.setManufacturer("Manufacturer"); tavAsset.setNSN("NationalStNo"); tavAsset.setOwnershipType("G"); tavAsset.setPalletType("A"); tavAsset.setSerialNumber("SerialNo"); tavAsset.setOrgShopDetailCode("shopOrg"); tavAsset.setSRAN("SRAN"); tavAsset.setVIN("VehicleId"); tavAsset.setWeight("99999"); tavAsset.setVehicleRegistration("VehReg");

4. Create the User Defined Records and add them to the parent object, TMAsset.

TMUserDefined tmUserDefined = tavAsset.createNewUserDefined("Name", "Value", false);

tavAsset.getUserDefinedRecords().add(tmUserDefined);

System.out.println("Creation of a TAV Asset object complete!");

5. Create the Tag target. Set the source as the TAV object and set the target as the Tag object.

TMTarget tagTarget = new TMTagTarget(oTag);

6. Write the Asset TAV data from the object to the Tag. Get the FormatWriter using FormatterFactory to write TAV data on Stream.

TMFormatterFactory formaterFactory = TMFormatterFactoryHelper.getInstance().getFormatterFactory();

TMFormatWriter tagWriter = formaterFactory.getTagWriter(tavAsset, tagTarget);

7. Write the Asset TAV data using this writer.

tagWriter.write();

System.out.println("Success in writing TMAsset TAV object to tag: " + TAG_ID);

Code Example: Creating a TAV Asset Object

The process to create an object for passing TAV Asset data is demonstrated in the following example. Child objects are created to contain the User Defined data and are then added to the parent object.

This example:

◆ Imports the required JRE, CAI, and TMM Java classes and interfaces ◆ Calls the CAI API (SaviRFIDDriver) to connect to a mobile reader on COM1 ◆ Calls the CAI API (TagFactory) to instantiate an ISO tag ◆ Calls the TMM API to create a TMAsset object ◆ Creates the User Defined Records and adds them to the newly created parent object, TMAsset ◆ Creates the Tag target and writes the asset TAV data from the object using FormatWriter This example was taken from the CreateTAVAssetObject.java file located in the gov.pmjait.tblmgr.samples package. Check that location for updates. Code relating to the CAI API is for demonstration purposes only; consult the CAI product documentation for information regarding its use.The data values are included to demonstrate the process; refer to the JDTAV v. 2.0 and v. 2.5 specifications for further information.

1 package gov.pmjait.tblmgr.samples;

3 //Java imports

4 import java.util.Iterator;

5 import java.util.List;

7 // CAI imports

8 import gov.pmjait.cai.RFIDDriver;

9 import gov.pmjait.cai.RFIDDriverManager;

10 import gov.pmjait.cai.device.Device;

11 import gov.pmjait.cai.device.DeviceConnection;

12 import gov.pmjait.cai.device.DeviceConnectionException;

13 import gov.pmjait.cai.device.DeviceConnectionFactory;

14 import gov.pmjait.cai.device.DeviceException;

15 import gov.pmjait.cai.device.ISO180007Reader;

16 import gov.pmjait.cai.device.Reader;

17 import gov.pmjait.cai.tag.Tag;

18 import gov.pmjait.cai.tag.TagFactory;

19 import gov.pmjait.tblmgr.excep.CommunicationException;

20 import gov.pmjait.tblmgr.excep.FormatterException;

21 import gov.pmjait.tblmgr.format.tav.TMAsset;

23 // Table Manager Module imports

24 import gov.pmjait.tblmgr.format.tav.TMTavCreationHelper;

25 import gov.pmjait.tblmgr.format.tav.TMUserDefined;

26 import gov.pmjait.tblmgr.formatter.TMFormatWriter;

27 import gov.pmjait.tblmgr.formatter.TMFormatterFactory;

28 import gov.pmjait.tblmgr.formatter.TMFormatterFactoryHelper;

29 import gov.pmjait.tblmgr.formatter.TMTagTarget;

30 import gov.pmjait.tblmgr.formatter.TMTarget;

32 /**

33 * <p>

34 * Title: CreateTAVAssetObject.java

35 * </p>

36 * <p>

37 * Description: This example demonstrates the process of creating a TMAsset object for Asset.

38 * The factory can be used to instantiate the parent object, followed by creating and adding 39 * the User Defined records. These children will be added to the parent using the 40 * interfaces on it.

41 * 42 * The data values used are purely for demonstration purposes only. please refer to the 43 * JDTAV 2.0/2.5 specification for guidance.

44 * </p>

45 * <p>

46 * Copyright: Copyright (c) 2008

47 * </p>

48 * <p>

49 * Company: PMJ-AIT

50 * </p>

51 * <p>

52 * Version: 1.0

53 * </p>

54 */

56 public class CreateTAVAssetObject {

58 private static final String TAG_ID = “18708883765846”;

60 public static void main(String[] args) {

62 try {

63 // attempt to load the RFID driver

64 RFIDDriverManager.loadDrivers();

66 // get the driver object reference (using the driver description) 67 RFIDDriver driver = RFIDDriverManager.getRFIDDriver(“Mobile Reader”);

68 Reader isoReader = getReader();

70 if (isoReader == null) {

71 System.out.println(“Program exiting as reader could not be obtained.”);

72 System.exit(0);

73 }

75 if (isoReader != null) {

77 TagFactory tf = driver.getTagFactory();

78 // Create the ISO 18000-7 tag 79 Tag oTag = (Tag) tf.createTag(TAG_ID, TagFactory.TYPE_ISO_18000_7_TAG,(Device) isoReader);

81 System.out.println(“ISO 18000-7 Tag instantiated: “ + oTag.getTagID());

83 // Table Manager Module specific code - Start

84 String version = TMTavCreationHelper.ValidTAVVersionNumbers.VER_02_50;

85 // Instantiate a new TMAsset (extends TMFormat) object using the factory and enforce 86 // data validation

87 TMAsset tavAsset = TMTavCreationHelper.getInstance().createNewAsset(version, false);

89 tavAsset.setAssetID(“assetid”);

90 tavAsset.setEquipmentDesc(“assetdesc”);

91 tavAsset.setAssetManagerOrganization(“test”);

92 tavAsset.setAssetManagerOrgType(“S”);

93 tavAsset.setAssetType(“V-AF”);

94 tavAsset.setBumperNumber(“bumperno”);

95 tavAsset.setCommand(“Cmd”);

96 tavAsset.setContainerNumber(“ContNum”);

97 tavAsset.setContainerSize(“20”);

98 tavAsset.setContainerType(“2”);

99 tavAsset.setContractNumber(“ContractNo”);

100tavAsset.setDateOfManufacture(“08082008”);

101tavAsset.setDateOfService(“09092008”);

102tavAsset.setDetailNumber(“DetailNo”);

103tavAsset.setIUID(“ItemUniqueId”);

104tavAsset.setLeaseEndDate(“09092010”);

105tavAsset.setLotNumber(“lotno”);;

106tavAsset.setManagementCode(“mgt”);

107tavAsset.setManufacturer(“Manufacturer”);

108tavAsset.setNSN(“NationalStNo”);

109tavAsset.setOwnershipType(“G”);

110tavAsset.setPalletType(“A”);

111tavAsset.setSerialNumber(“SerialNo”);

112tavAsset.setOrgShopDetailCode(“shopOrg”);

113tavAsset.setSRAN(“SRAN”);

114tavAsset.setVIN(“VehicleId”);

115tavAsset.setWeight(“99999”);

116tavAsset.setVehicleRegistration(“VehReg”);

118// Create User Defined Records...add them to the parent TMAsset

119// More than one user defined record can be added to the list.

The number

120// is limited by the memory on the tag.

121TMUserDefined tmUserDefined = tavAsset.createNewUserDefined(“Name”, “Value”, false);

122tavAsset.getUserDefinedRecords().add(tmUserDefined);

124System.out.println(“Creation of a TAV Asset object complete!”);

126// Create the Tag target...

127TMTarget tagTarget = new TMTagTarget(oTag);

129// Write the Asset TAV data in the object to the Tag

130// Get the Tag Writer using the Formatter Factory

131TMFormatterFactory formaterFactory = TMFormatterFactoryHelper.getInstance().getFormatterFactory();

132TMFormatWriter tagWriter = formaterFactory.getTagWriter(tavAsset, tagTarget);

134// Write Asset TAV data using this writer

135tagWriter.write();

137// Table Manager Module specific code - End

139System.out.println(“Success in writing TMAsset TAV object to tag: “ + TAG_ID);

140}

142isoReader.getDeviceConnection().closeConnection();

144} catch (FormatterException ex) {

145System.out.println(“Error Code : “ + ex.getErrorCode());

146System.out.println(“Error Msg : “+ ex.getLocalizedMessage());

147System.exit(0);

148} catch (CommunicationException ex){

149System.out.println(“Error Code : “ + ex.getErrorCode());

150System.out.println(“Error Msg : “+ ex.getLocalizedMessage());

151System.exit(0);

152} catch (Exception ex) {

153ex.printStackTrace();

154System.out.println(ex.toString());

155System.out.println(ex.getLocalizedMessage());

156System.exit(0);

157}

158}

160 private static Reader getReader() {

161try {

162// Attempt to load the DODRFID driver

163RFIDDriverManager.loadDrivers();

165// Get the driver object reference (using the driver description) 166RFIDDriver driver = RFIDDriverManager.getRFIDDriver(“Mobile Reader”);

168// Next get the Device Connection Factory associated with this driver 169DeviceConnectionFactory dcf = driver.getDeviceConnectionFactory();

171// Now attempt to create a Device Connection object

172DeviceConnection deviceConnection = dcf.createDeviceConnection();

173deviceConnection.openConnection();

174// Next discover all devices on this connection - for this example 175// a mobile reader is used

176List deviceList = (List) deviceConnection.discoverDevices();

177System.out.println(deviceList.toString());

178if (deviceList.size() == 0) { 179System.out.println(“No devices were detected on the connection.”);

180deviceList = (List)deviceConnection.discoverDevices();

181}

182// Here we shall assume that device zero is a Mobile Reader

183Iterator deviceIter = deviceList.iterator();

184Device deviceZero = null;

185while (deviceIter.hasNext()) {

186Device curDevice = (Device) deviceIter.next();

187deviceZero = curDevice;

188break;

189}

191ISO180007Reader reader = null;

if(deviceZero.getDeviceType().equals(Device.DEVICE_TYPE_READER)

193// Here we can downcast to a reader

194 reader = (ISO180007Reader) deviceZero;

195}

196return reader;

197} catch (DeviceConnectionException ex) {

198System.out.println(ex);

199} catch (DeviceException ex) {

200System.out.println(ex);

201} catch (Exception ex){

202System.out.println(ex);

203}

204return null;

205}

206} How to: Create a TAV Sustainment Object

The code snippets are from the CreateTAVSustainmentObject.java file located in the gov.pmjait.tblmgr.samples package. Check that location for updates to the code.

The parent object, TMSustainment, can have child objects that contain Commodity, TCMD, and User Defined data. A Commodity object can in turn have child Lots, and Lots can have child Serials.

The data values are included to demonstrate the process; refer to the JDTAV v. 2.0 and v. 2.5 specifications for further information.

Note: Steps 1 through 14 demonstrate how to create the object and steps 15 through 16 demonstrate how to write the data to a tag.

1. Import the required TMM Java classes and interfaces.

import gov.pmjait.tblmgr.excep.CommunicationException; import gov.pmjait.tblmgr.excep.FormatterException; import gov.pmjait.tblmgr.format.tav.TMCommodity;

import gov.pmjait.tblmgr.format.tav.TMLot;

import gov.pmjait.tblmgr.format.tav.TMSerialNumber; import gov.pmjait.tblmgr.format.tav.TMSustainment; import gov.pmjait.tblmgr.format.tav.TMTCMD;

import gov.pmjait.tblmgr.format.tav.TMTavCreationHelper;

import gov.pmjait.tblmgr.format.tav.TMUserDefined; import gov.pmjait.tblmgr.formatter.TMFormatWriter; import gov.pmjait.tblmgr.formatter.TMFormatterFactory;

import gov.pmjait.tblmgr.formatter.TMFormatterFactoryHelper;

import gov.pmjait.tblmgr.formatter.TMTagTarget;

import gov.pmjait.tblmgr.formatter.TMTarget;

2. Declare the TAV summary values.

String containerNumber = "CONTNUMBER"; String leadTCN = "LeadTCN";

String poe = "POE"; String pod = "POD";

String consigneeDODAAC = "consi"; String consignorDODAAC = "consn"; String carrierCode = "code"; String transportPriority = "1"; char hazmatCode = 'U';

String shipDate = "123"; String pieceCount = "23"; String weight = "45"; String cube = "34";

String comments = "ABCDERT4566";

String version = TMTavCreationHelper.ValidTAVVersionNumbers.VER_02_50;

String netExplosiveWeight = "3456";

String commodtiyClass = "CLASS-I"; String hazardClass = "HZ";

String operationName = "OS";

3. Create a new TMSustainment object using TMTAVCreationHelper (this extends the TMTav interface) and enforce data validation by setting flag to false.

TMSustainment tavSust = TMTavCreationHelper.getInstance() .createNewSustainment(version, false);

4. Set the data members in the TAV summary. tavSust.setContainerNumber(containerNumber); tavSust.setShipmentId(leadTCN); tavSust.setPOE(poe);

tavSust.setPOD(pod);

tavSust.setConsigneeDODAAC(consigneeDODAAC); tavSust.setConsignorDODAAC(consignorDODAAC); tavSust.setCarrierCode(carrierCode); tavSust.setTransportPriority(transportPriority); tavSust.setHazmatCode(hazmatCode); tavSust.setShipDate(shipDate); tavSust.setPieceCount(pieceCount); tavSust.setWeight(weight);

tavSust.setCube(cube); tavSust.setComments(comments); tavSust.setNetExplosiveWeight(netExplosiveWeight); tavSust.setCommodityClass(commodtiyClass); tavSust.setHazardClass(hazardClass); tavSust.setOperationName(operationName);

5. Create a Commodity record and set the values.

TMCommodity tavCommodity = tavSust.createNewCommodity(false); tavCommodity.setConditionCode('C'); tavCommodity.setDocument("document"); tavCommodity.setIntermediateTCN("intermediateTCN"); tavCommodity.setLIN("lin1");

tavCommodity.setMisc1("misc1"); tavCommodity.setMisc2("misc2"); tavCommodity.setNomenclature("noclature"); tavCommodity.setNSN("nsn"); tavCommodity.setQuantity("99999"); tavCommodity.setRouteId("rte");

tavCommodity.setUnitIssue("EA");

tavCommodity.setSequenceNumber("1");

6. Create a child Lot and add it to the parent Commodity.

TMLot tmlot = tavSust.createNewLot(false); tmlot.setId("1000"); tmlot.setQuantity("9999");

7. Create a child Serial and add it to the parent lot.

TMSerialNumber tmSerial = tavSust.createNewSerialNumber("100", false);

tmSerial.setId("100"); tmSerial.setQuantity("1"); tmSerial.setParentLotId("12345678901234567890");

8. Add the Serial to the parent Lot.

tmlot.getSerialNumbers().add(tmSerial);

9. Add the Lot to the parent commodity.

tavCommodity.getLotNumbers().add(tmlot);

10.Add the Commodity record to the parent TMSustainment object.

tavSust.getCommodityRecords().add(tavCommodity);

11.Create a new TCMD record.

TMTCMD tmTCMD = tavSust.createNewTCMD("TE203779TEXU20412I4 1N4PN3KYCW67G230984V009KK2Y000001159S01159X13600001300611360", false);

12.Add the TCMD record to the parent object TMSustainment.

tavSust.getTCMDRecords().add(tmTCMD);

13.Create the User Defined Records and add them to the parent TMSustainment object.

TMUserDefined tmUserDefined = tavSust.createNewUserDefined("Name", "Value", false);

tavSust.getUserDefinedRecords().add(tmUserDefined);

System.out.println("Creation of TAV Sustainment object complete!");

14.Create the Tag target. Set the source as the TAV object and set the target as the Tag object.

TMTarget tagTarget = new TMTagTarget(oTag);

15.Write the TAV data from the object to the Tag. Get the FormatWriter using FormatterFactory that can write TAV on Stream.

TMFormatterFactory formaterFactory = TMFormatterFactoryHelper.getInstance().getFormatterFactory();

TMFormatWriter tagWriter = formaterFactory.getTagWriter(tavSust, tagTarget);

16.Write the TAV data using this writer.

tagWriter.write();

System.out.println("Success in writing TMSustainment object to tag: " + TAG_ID);

Code Example: Creating a TAV Sustainment Object

The process to create an object for passing TAV Sustainment data is demonstrated in the following example. Child objects are created to contain the Commodity, TCMD, and User Defined data and are then added to the parent object.

This example:

◆ Imports the required JRE, CAI, and TMM Java classes and interfaces ◆ Calls the CAI API (SaviRFIDDriver) to connect to a mobile reader on COM1 ◆ Calls the CAI API (TagFactory) to instantiate an ISO tag ◆ Calls the TMM API and creates a parent object (TMSustainment) for writing the TAV Sustainment data ◆ Creates Commodity, Lot, Serial, TCMD, and User Defined child objects to hold the respective data ◆ Adds the child objects to their respective parent objects ◆ Writes the TAV Sustainment data to the tag This example was taken from the CreateTAVSustainmentObject.java file located in the gov.pmjait.tblmgr.samples package. Check that location for updates. Code relating to the CAI API is for demonstration purposes only; consult the CAI product documentation for information regarding its use. The data values are included to demonstrate the process; refer to the JDTAV v. 2.0 and v. 2.5 specifications for further information.

1 package gov.pmjait.tblmgr.samples;

3 //Java imports

4 import java.util.Iterator;

5 import java.util.List;

7 // CAI imports

8 import gov.pmjait.cai.RFIDDriver;

9 import gov.pmjait.cai.RFIDDriverManager;

10 import gov.pmjait.cai.device.Device;

11 import gov.pmjait.cai.device.DeviceConnection;

12 import gov.pmjait.cai.device.DeviceConnectionException;

13 import gov.pmjait.cai.device.DeviceConnectionFactory;

14 import gov.pmjait.cai.device.DeviceException;

15 import gov.pmjait.cai.device.ISO180007Reader;

16 import gov.pmjait.cai.device.Reader;

17 import gov.pmjait.cai.tag.Tag;

18 import gov.pmjait.cai.tag.TagFactory;

20 // Table Manager imports

21 import gov.pmjait.tblmgr.excep.CommunicationException;

22 import gov.pmjait.tblmgr.excep.FormatterException;

23 import gov.pmjait.tblmgr.format.tav.TMCommodity;

24 import gov.pmjait.tblmgr.format.tav.TMLot;

25 import gov.pmjait.tblmgr.format.tav.TMSerialNumber;

26 import gov.pmjait.tblmgr.format.tav.TMSustainment;

27 import gov.pmjait.tblmgr.format.tav.TMTCMD;

28 import gov.pmjait.tblmgr.format.tav.TMTavCreationHelper;

29 import gov.pmjait.tblmgr.format.tav.TMUserDefined;

30 import gov.pmjait.tblmgr.formatter.TMFormatWriter;

31 import gov.pmjait.tblmgr.formatter.TMFormatterFactory;

32 import…

This is the start of the file's text. The full file is on GovTribe.

File details come from the government source that posted it. Updated .