Apostrophe Systems EPC Generator 2.0

EPCConfiguration Class

EPCConfiguration is used to read configuration settings from the <EPCConfig> configuration section.

For a list of all members of this type, see EPCConfiguration Members.

System.Object
   Apostrophe.EPC.EPCConfiguration

public class EPCConfiguration : IConfigurationSectionHandler

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

One main reason this configuration section exists is to tell the EPC Generator about Company Prefix Index information. 64 Bit EPC Numbers do not use a complete Company Prefix, rather 64-Bit EPC Numbers use a Company Prefix Index. Company Prefixes are translated into a Company Prefix Index by quering an EPC Translation Table. EPC Global is soley responsible for the assignment of Company Prefix Indicies and maintaining the Translation Table.

The EPC Generator API will use this table when possible. The EPC Generator API will not use this table if, for example, you are running the EPC Generator API from a location without internet access or if you set the monitorTranslationTable configuration attribute to false, which is the default value. When the EPC Generator is set to monitor the Translation Table, it will do so periodically and store its results in an xml file named ManagerTranslations.xml which can be found in the same path as the Apostrophe.EPC.dll.

Sometimes it is possible that you are going to need a 64-Bit encoding for an EPC Number that has no entry in the Translation Table. If this is the case, you can configure your own Translation Table entries in the <EPCConfig> configuration section. It is important to understand that according to EPC Global, a 64-Bit EPC Number encoded with a Company Prefix Index that is not in the Translation Table is considered to be an "Illegal Encoding".

To retrieve a Company Prefix Index based on a Company Prefix from the EPC Generator API, the caller uses the ManagerTranslator class. IMPORTANT : Configuring a Company Prefix Index in this manner should only be done for test or development purposes. If the company prefix index is configured using the the <EPCConfig> configuration section, make sure that the value does not exist in the real Translation Table.

Example

This is an example of the cofiguration settings for the EPC Generator.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
 <configSections>
  <section name="EPCConfig" type="Apostrophe.EPC.EPCConfiguration,Apostrophe.EPC"/>
 </configSections>

 <EPCConfig defaultFormat="HEX">
  <EPC64Table monitorTranslationTable=false >
   <entry index="21" companyPrefix="0652642"/>
  </EPC64Table>
 </EPCConfig>
 
</configuration>

 //Get the Company Prefix for a configured Translation Table Entry
 int companyPrefixIndex = ManagerTranslator.GetCompanyPrefixIndex("0652642");
 

Requirements

Namespace: Apostrophe.EPC

Assembly: Apostrophe.EPC (in Apostrophe.EPC.dll)

See Also

EPCConfiguration Members | Apostrophe.EPC Namespace