This class represents a GRAI 96 and 64 EPC identity type. Its main function is to translate from a UCC.EAN GRAI to an GRAI EPC Encoding and assign user managed serial numbers to the EPC Encoding. This class can also decode a GRAI EPC Identity type that is formatted in HEX representation.
For a list of all members of this type, see GRAI Members.
System.Object
Apostrophe.EPC.EPCBase
Apostrophe.EPC.GRAI
Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.
//create a 96 bit GRAI EPC Number
GRAI grai = new GRAI(96);
//pass in the UPC Number, Filter, and Serial Number
grai.Encode("07234567890005",3,1);
//write the GRAI Encoding to the console in the default format of HEX.
Console.Write(grai.ToString());
//Calling ToXml() will return the following XML Document
<?xml version='1.0' encoding='utf-8' standalone='yes'?>
<Tag type='GRAI' size='96'>
<Fields>
<Field name='Header' value='51'/>
<Field name='Filter' value='3'/>
<Field name='Partition' value='5'/>
<Field name='CompanyPrefix' value='072345'/>
<Field name='AssetType' value='89000'/>
<Field name='SerialNumber' value='1'/>
</Fields>
<Encodings>
<Encoding name='HEX' value='3374046A6456EA0000000001'/>
<Encoding name='BINARY' value='001100110111010000000100011010100110010001010110111010100000000000000000000000000000000000000001'/>
<Encoding name='URI' value='urn:epc:tag:grai-96:072345.89000.1'/>
<Encoding name='PUREIDENTITY' value='urn:epc:id:grai:072345.89000.1'/>
</Encodings>
</Tag>
Namespace: Apostrophe.EPC
Assembly: Apostrophe.EPC (in Apostrophe.EPC.dll)
GRAI Members | Apostrophe.EPC Namespace