Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop-itip'
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny Haak committed Mar 9, 2018
2 parents 47bb809 + 8eeabf3 commit f3f64d7
Show file tree
Hide file tree
Showing 61 changed files with 22,693 additions and 957 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#build
[Oo]bj/
[Bb]in/
[O]out/
packages/
TestResults/

Expand Down Expand Up @@ -40,3 +41,5 @@ Thumbs.db
*.dotCover

*.nupkg
.vs
out
78 changes: 67 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
## Synopsis

Tag Data Translation implemented according to the GS1 EPC Tag Data Translation 1.6 specification (http://www.gs1.org/epc/tag-data-translation-standard) for RAIN RFID. Comes with unit tests and a demonstration application.
Tag Data Translation implemented according to the GS1 EPC Tag Data Translation 1.6 specification (http://www.gs1.org/epc/tag-data-translation-standard) for RAIN RFID, and updated for Tag Data Standard 1.11. Comes with unit tests and a demonstration application. Online accessible at https://www.mimasu.nl/tdt.

An online demo is available at https://www.mimasu.nl.

The following schemes are supported:
- ADI-var
- GDTI-96 and GDTI-113
- GIAI-96 and GIAI-202
- CPI-96, CPI-var
- GTDI-96, GDTI-174
- GIAI-96, GIAI-202
- GID-96
- GRAI-96
- GRAI-96, GRAI-170
- GSRN-96
- SGLN-96 and SGLN-195
- SGTIN-96 and SGTIN-198
- GSRNP-96
- ITIP-110, ITIP-212
- SGCN-96
- SGLN-96, SGLN-195
- SGTIN-96, SGTIN-198
- SSCC-96
- USDOD-96

Expand All @@ -22,7 +26,7 @@ The following programming languages are supported:

## Example

The following code is an example on how to use the library.
The following code is an example on how to use the library, to go from a GTIN and serial to hexadecimal.

```
TDTEngine engine = new TDTEngine ();
Expand All @@ -32,29 +36,40 @@ string binary = engine.Translate(epcIdentifier, parameterList, @"BINARY");
string binaryHex = engine.BinaryToHex(binary);
```

Or the other way around.

```
TDTEngine engine = new TDTEngine ();
string epcIdentifier = engine.HexToBinary(@"30340242201d8840009efdf7");
string parameterList = @"tagLength=96";
string legacy = engine.Translate(epcIdentifier, parameterList, @"LEGACY");
```

## API

The library follows the client API as defined in the standard.
The library follows the client API as defined in the standard and there are some additional helper functions.

### Translate

```
public String translate(String epcIdentifier, String parameterList, String outputFormat)
```

Translates epcIdentifier from one representation into another within the same coding scheme.

### Parameters
#### Parameters

| Parameter | Description |
| ------------- | ----------- |
| epcIdentifier | The epcIdentifier to be converted. This should be expressed as a string, in accordance with one of the grammars or patterns in the TDT markup files, i.e. a binary string consisting of characters '0' and '1', a URI (either tag-encoding or pure-identity formats), or a serialized identifier expressed as in Table 3. |
| parameterList | This is a parameter string containing key value pairs, using the semicolon [';'] as delimiter between key=value pairs. For example, to convert a GTIN code the parameter string would look like the following: `filter=3;companyprefixlength=7;tagLength=96` |
| outputFormat | The output format into which the epcIdentifier SHALL be converted. The following are the formats supported: `BINARY`, `LEGACY`, `LEGACY_AI`, `TAG_ENCODING`, `PURE_IDENTITY` |

### Returns
#### Returns

The converted value into one of the above formats as String.

### Throws
#### Throws

**TDTTranslationException** – Throws exceptions due to the following reason:

Expand All @@ -69,6 +84,47 @@ The converted value into one of the above formats as String.
9. `TDTLookupFailed` Reported if lookup in an external table failed to provide a value – reports table URI and path expression.
10. `TDTNumericOverflow` Reported when a numeric overflow occurs when handling numeric values such as serial number.

### GetPrefixLength

```
public PrefixLengthResult GetPrefixLength(string input)
```

Gets the GS1 Prefix Length for the given identifier. Based on the gcpprefixformatlist.xml file from GS1 (GCP Length Table, https://www.gs1.org/standards/bc-epc-interop).

#### Parameters

| Parameter | Description |
| ------------- | ----------- |
| input | Identifier for which to find the GS1 Prefix Length. Input as string. |

#### Returns

An object with the following properties.

| Property | Description |
| ------------- | ----------- |
| Prefix | The full GS1 Prefix as a string. |
| Length | The length of the GS1 Prefix as integer. |

### GetFilterValueTable

```
public Dictionary<int, string> GetFilterValueTable(string scheme)
```

Gets the Filter Value table for the provided scheme.

#### Parameters

| Parameter | Description |
| ------------- | ----------- |
| scheme | The GS1 EPC scheme for which to retrieve the Filter Value Table. Input as string. |

#### Returns

A dictionary with an integer as key (Filter Value) and a string as value (description).

## License

This library is dual-licensed:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<OutputType>Library</OutputType>
<RootNamespace>TagDataTranslationnet</RootNamespace>
<AssemblyName>TagDataTranslation-net</AssemblyName>
<ReleaseVersion>0.3.1</ReleaseVersion>
<ReleaseVersion>1.0.0</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand All @@ -30,6 +30,7 @@
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Numerics" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
Expand All @@ -45,52 +46,118 @@
<Compile Include="..\TagDataTranslation\TranslateResult.cs">
<Link>TranslateResult.cs</Link>
</Compile>
<Compile Include="..\TagDataTranslation\PrefixLengthResult.cs">
<Link>PrefixLengthResult.cs</Link>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\TagDataTranslation\XMLArtifacts\ADI-var.xml">
<Link>XMLArtifacts\ADI-var.xml</Link>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\ADI-var.xml">
<Link>Schemes\ADI-var.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\CPI-96.xml">
<Link>Schemes\CPI-96.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\CPI-var.xml">
<Link>Schemes\CPI-var.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\GDTI-174.xml">
<Link>Schemes\GDTI-174.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\GDTI-96.xml">
<Link>Schemes\GDTI-96.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\GIAI-202.xml">
<Link>Schemes\GIAI-202.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\GIAI-96.xml">
<Link>Schemes\GIAI-96.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\GID-96.xml">
<Link>Schemes\GID-96.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\GRAI-170.xml">
<Link>Schemes\GRAI-170.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\GRAI-96.xml">
<Link>Schemes\GRAI-96.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\GSRN-96.xml">
<Link>Schemes\GSRN-96.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\GSRNP-96.xml">
<Link>Schemes\GSRNP-96.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\ITIP-110.xml">
<Link>Schemes\ITIP-110.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\ITIP-212.xml">
<Link>Schemes\ITIP-212.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\SGCN-96.xml">
<Link>Schemes\SGCN-96.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\SGLN-195.xml">
<Link>Schemes\SGLN-195.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\SGLN-96.xml">
<Link>Schemes\SGLN-96.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\SGTIN-198.xml">
<Link>Schemes\SGTIN-198.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\SGTIN-96.xml">
<Link>Schemes\SGTIN-96.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\SSCC-96.xml">
<Link>Schemes\SSCC-96.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\Schemes\USDOD-96.xml">
<Link>Schemes\USDOD-96.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\GCPPrefixFormatList\gcpprefixformatlist.xml">
<Link>GCPPrefixFormatList\gcpprefixformatlist.xml</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\XMLArtifacts\GDTI-113.xml">
<Link>XMLArtifacts\GDTI-113.xml</Link>
<EmbeddedResource Include="..\TagDataTranslation\FilterValueTables\filter-ADI.csv">
<Link>FilterValueTables\filter-ADI.csv</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\XMLArtifacts\GDTI-96.xml">
<Link>XMLArtifacts\GDTI-96.xml</Link>
<EmbeddedResource Include="..\TagDataTranslation\FilterValueTables\filter-CPI.csv">
<Link>FilterValueTables\filter-CPI.csv</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\XMLArtifacts\GIAI-202.xml">
<Link>XMLArtifacts\GIAI-202.xml</Link>
<EmbeddedResource Include="..\TagDataTranslation\FilterValueTables\filter-GDTI.csv">
<Link>FilterValueTables\filter-GDTI.csv</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\XMLArtifacts\GIAI-96.xml">
<Link>XMLArtifacts\GIAI-96.xml</Link>
<EmbeddedResource Include="..\TagDataTranslation\FilterValueTables\filter-GIAI.csv">
<Link>FilterValueTables\filter-GIAI.csv</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\XMLArtifacts\GID-96.xml">
<Link>XMLArtifacts\GID-96.xml</Link>
<EmbeddedResource Include="..\TagDataTranslation\FilterValueTables\filter-GID.csv">
<Link>FilterValueTables\filter-GID.csv</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\XMLArtifacts\GRAI-170.xml">
<Link>XMLArtifacts\GRAI-170.xml</Link>
<EmbeddedResource Include="..\TagDataTranslation\FilterValueTables\filter-GRAI.csv">
<Link>FilterValueTables\filter-GRAI.csv</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\XMLArtifacts\GRAI-96.xml">
<Link>XMLArtifacts\GRAI-96.xml</Link>
<EmbeddedResource Include="..\TagDataTranslation\FilterValueTables\filter-GSRN.csv">
<Link>FilterValueTables\filter-GSRN.csv</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\XMLArtifacts\GSRN-96.xml">
<Link>XMLArtifacts\GSRN-96.xml</Link>
<EmbeddedResource Include="..\TagDataTranslation\FilterValueTables\filter-GSRNP.csv">
<Link>FilterValueTables\filter-GSRNP.csv</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\XMLArtifacts\SGLN-195.xml">
<Link>XMLArtifacts\SGLN-195.xml</Link>
<EmbeddedResource Include="..\TagDataTranslation\FilterValueTables\filter-ITIP.csv">
<Link>FilterValueTables\filter-ITIP.csv</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\XMLArtifacts\SGLN-96.xml">
<Link>XMLArtifacts\SGLN-96.xml</Link>
<EmbeddedResource Include="..\TagDataTranslation\FilterValueTables\filter-SGCN.csv">
<Link>FilterValueTables\filter-SGCN.csv</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\XMLArtifacts\SGTIN-198.xml">
<Link>XMLArtifacts\SGTIN-198.xml</Link>
<EmbeddedResource Include="..\TagDataTranslation\FilterValueTables\filter-SGLN.csv">
<Link>FilterValueTables\filter-SGLN.csv</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\XMLArtifacts\SGTIN-96.xml">
<Link>XMLArtifacts\SGTIN-96.xml</Link>
<EmbeddedResource Include="..\TagDataTranslation\FilterValueTables\filter-SGTIN.csv">
<Link>FilterValueTables\filter-SGTIN.csv</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\XMLArtifacts\SSCC-96.xml">
<Link>XMLArtifacts\SSCC-96.xml</Link>
<EmbeddedResource Include="..\TagDataTranslation\FilterValueTables\filter-SSCC.csv">
<Link>FilterValueTables\filter-SSCC.csv</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\TagDataTranslation\XMLArtifacts\USDOD-96.xml">
<Link>XMLArtifacts\USDOD-96.xml</Link>
<EmbeddedResource Include="..\TagDataTranslation\FilterValueTables\filter-USDOD.csv">
<Link>FilterValueTables\filter-USDOD.csv</Link>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Expand Down
Loading

0 comments on commit f3f64d7

Please sign in to comment.