zplCore.comzplCore.com
class35 members

Epc

public sealed class Epc

An encoded or decoded EPC (GS1 EPC Tag Data Standard 2.3): the GS1 key it identifies, filter value, binary / hex encoding for the EPC memory bank and the URI forms. Created by ZplRfid.EncodeEpc, ZplRfid.DecodeEpc and ZplRfid.ParseEpcUri.

Properties

PropertyTypeDescription
AidcDataBits { get; }stringBits after the EPC when Epc.HasAidcData (not decoded; null otherwise).
Binary { get; }stringExact binary encoding ('0'/'1', header first) without padding.
BitLength { get; }intLength of Epc.Binary in bits.
CompanyPrefix { get; }stringThe EPC CompanyPrefix component (null when Epc.CompanyPrefixLength is unknown).
CompanyPrefixLength { get; }int?Number of digits of the EPC CompanyPrefix component (6–12): encoded in the partition of the fixed-length schemes, given by the caller for the "+" schemes (null when unknown).
Date { get; }stringDSGTIN+: the prioritised date YYMMDD.
DateAi { get; }stringDSGTIN+: AI of the prioritised date ("11", "13", "15", "16", "17", "7006" or "7007").
DigitalLinkUri { get; }stringGS1 Digital Link URI on id.gs1.org (Gs1DigitalLink.Build), e.g. "https://id.gs1.org/01/09506000134352/21/6789".
ElementString { get; }stringGS1 element string in bracketed form, e.g. "(01)09506000134352(21)6789".
Elements { get; }IReadOnlyList<Gs1Element>The GS1 element strings of the EPC identity.
Filter { get; }intFilter value 0–7 (control information, not part of the EPC identity; TDS §10).
FilterName { get; }stringMeaning of Epc.Filter for this key (TDS Tables 10-1 to 10-5), e.g. "Point of Sale (POS) Trade Item".
Giai { get; }stringGIAI, AI (8004).
Gln { get; }stringGLN (13 digits) of an SGLN.
GlnExtension { get; }stringGLN extension, AI (254); null for an SGLN without extension (encoded as extension "0", TDS §7.5).
Grai { get; }stringGRAI without serial: the 14 digits after AI (8003) (leading pad '0', company prefix, asset type, check digit).
Gtin { get; }stringGTIN-14 of an SGTIN / DSGTIN+.
HasAidcData { get; }bool"+" schemes: the +AIDC data toggle bit is set (additional AIDC data follows the EPC; TDS §14.5.1, §15.3).
Hex { get; }stringThe encoding as written to the EPC memory bank from bit 20h: hexadecimal, zero-padded to whole 16-bit words (TDS §15.1.1), e.g. 24 digits for a 96-bit EPC.
KeyType { get; }EpcKeyTypeThe GS1 key.
PureIdentityUri { get; }stringEPC Pure Identity URI (TDS §6.3), e.g. "urn:epc:id:sgtin:9506000134352.05.6789"; null when the company prefix length is unknown ("+" schemes decoded from binary).
Scheme { get; }EpcSchemeThe binary coding scheme.
SchemeInfo { get; }EpcSchemeInfoHeader, TDS name and length of Epc.Scheme.
Serial { get; }stringSerial number: AI (21) of an SGTIN, serial component of a GRAI (null for other keys).
Sscc { get; }stringSSCC (18 digits).
TagUri { get; }stringEPC Tag URI with the filter value (TDS §12), e.g. "urn:epc:tag:sgtin-96:3.95060001343.05.6789"; null for the "+" schemes, for which TDS 2.x defines no Tag URI.
Warnings { get; }IReadOnlyList<string>Warnings of the encoding or decoding (reserved filter value, ignored AIs, non-zero padding …).
WordCount { get; }intNumber of 16-bit words the EPC occupies in the EPC memory bank from bit 20h (PC length field).

Methods

Method SignatureReturnsDescription
# ConvertTo(EpcScheme scheme, int? filter = default)EpcThe same identity in another scheme (e.g. SGTIN-96 → SGTIN+), with an optional new filter value.
# Equals(object obj)boolSame scheme, filter and binary encoding.
# GetHashCode()int
# PcWord(bool userMemoryIndicator = false)ushortProtocol control word for this EPC (EPC bank bits 10h–1Fh, TDS Table 15-1): length = Epc.WordCount, UMI as given, XPC indicator 0, toggle 0 (GS1 EPC), attribute bits 0. 3000h for a 96-bit EPC.
# ToBytes()byte[]Epc.Hex as bytes.
# ToPureIdentityUri(int companyPrefixLength)stringPure Identity URI with an explicit company prefix length (6–12; 4 and 5 are treated as 6).
# ToString()stringTag URI when defined, else the element string with the scheme name.