ModuleAPI C# Version Developer's Guide
MODULETECH
  
Defines some base classes associated with tag operations and the Reader class, the Reader class contains various methods of tag operation and methods related to configuring reader parameters.

Reader Class

This is the most important class, encapsulates all the functions of tag operation and manages the life cycle of reader
  
Main Methods
Method name Description
Create Create an instance of the Reader class.
Disconnect Free the resource of the instance of the reader class.
ParamGet Get parameters of reader.
ParamSet Set parameters of reader.
Read Synchronous inventory operation.
StartReading Start asynchronous inventory operation.
StopReading Stop asynchronous inventory operation.
ReadTagMemWords Read the data block of the tag's one storage area.
WriteTagMemWords Write data block to tag's one storage area.
WriteTag Write the EPC code of a tag.
LockTag Lock the tag's storage areas.
KillTag Kill a tag
GPIGet Get GPI state
GPOSet Set GPO state

ByteFormat Class

Convert among hexadecimal string, ushort array and byte array.
  
FromHex method

Convert hexadecimal string to byte array.
  
Method Signature
  
public static byte[] FromHex(string hex)
  
Parameters
Parameter Description
hex The hexadecimal string to convert.
   
Return Value
Hexadecimal string
  
Example
  
byte[] bepc = ByteFormat.FromHex("1234abcd");
    
ToHex Method

Convert ushort array to hexadecimal string.
 
Method Signature
  
public static string ToHex(ushort[] words)
  
Parameters
Parameter Description
words The ushort array to convert.
   
Return Value
Hexadecimal string
  
Example
  
string readdata = ByteFormat.ToHex(new ushort[] {1,2,4});
  
ToHex Method

Convert bytes array to hexadecimal string.
 
Method Signature
  
public static string ToHex(byte[] bytes)
  
Parameters
Parameter Description
bytes The bytes array to convert.
   
Return value
Hexadecimal string
   
Example
  
string epc = ByteFormat.ToHex(new byte[] {1,2,3,4});
  

SimpleReadPlan Class

Specify the antennas and tag protocol when inventory. ModuleTech.ReadPlan is the base class which would not be used in practice.
  
Constructor

  
public SimpleReadPlan(int[] antennas)
  
Parameters
Parameter Description
antennas The working antennas when inventory
  
Example
Use No.1 No.2 and No.4 antenna when inventory.
  
int [] ants = new int[]{1, 2, 4};
SimpleReadPlan plan = new SimpleReadPlan(ants);

Region Enumeration

The working frequency regulatory of reader, it is usually set as ModuleTech.Region.NA.
  
Member Description
UNSPEC Unspecific area
CN Canada
EU Europe version 1(LBT)
EU2 Europe version 2
EU3 Europe version3 (no LBT)
IN India
KR Korea
JP Japan
NA North America
PRC China (920-925)
PRC2 China(840-845)
OPEN Full frequency(860-960)

ReaderIPInfo Class

The IP information of reader, using ReaderIPInfo.Create create ReaderIPInfo
  
Attributes
Attribute Description
GATEWAY Gateway
IP IP address
SUBNET Subnet mask
  
Constructor

  
public static ModuleTech.ReaderIPInfo Create(string ip, string subnet, string gateway)
   
Parameters
Parameter Description
ip Read only, the IP address of reader.
subnet Read only, the subnet mask of reader.
gateway Read only, the gateway of reader.

ReaderIPInfo_Ex.WifiSetting Class

The wifi settings
  
Attributes
Attribute Description
Auth Read only, WiFi authentication mode.
SSID Read only, WiFi ssid.
KEY Read only, WiFi password.
  
Constructor

  
WifiSetting(AuthMode auth, string ssid, KeyType ktype, string key)
  
Parameters
Parameter Decription
auth WiFi authentication mode,Legal value:AuthMode_Open,AuthMode_Open_Wep, AuthMode_Shared_Wep,AuthMode_Wpa_Psk, AuthMode_Wpa2_Psk.
ssid SSID of WiFi setting.
ktype Wifi password type, Legal value: KeyType_HEX means hexadecimal characte,KeyType_ASC2 means ASC2 character.
key Password

ReaderIPInfo_Ex Class

The reader IP information including the wifi parameter
    
Attributes
Attribute Description
IPInfo Basic IP information.
NType Read only, net type.
Wifi Read only, WiFi setting parameter.
   
Constructor

  
ReaderIPInfo_Ex(ReaderIPInfo ip, NetType type, WifiSetting wifi)
   
Parameters
Parameter Description
ip IP, subnet mask, gateaway
type Net type,legal value: NetType_Ethernet, NetType_Wifi
wifi WiFi setting parameter

TagData Class

using for function WriteTag
 
Constructor

  
public TagData(byte[] epc)
   
Parameters
Parameter Description
epc EPC data
 
Constructor

  
public TagData(string epc)
  
Parameters
Parameter Description
epc EPC data represented by hexadecimal string

TagFilter Interface

Use for filter tags when tag operation

TagLockAction Class

The base class of ModuleTech.Gen2.Gen2LockAction

TagProtocol Enumeration

Air interface protocol
 
Member Description
EPC0_IMPINJ EPC0 of IMPINJ
EPC0_MATRICS EPC0 of MATRICS
EPC1 EPC1 protocol
GEN2 GEN2 protocol
ISO18000_6B ISO 18000-6B protocol
NONE None
UCODE UCODE protocol
IPX64 IPX64 protocol
IPX256 IPX256 protocol

TagReadData Class

The result of Inventory
 
Attributes
Attribute Description
Antenna Read only, meaning the antenna that read tag.
EPC Read only, EPC data.
EPCString Read only, the hexadecimal form of EPC.
ReadCount Read only, the number of times read.
Tag Read only, the tagdata form of EPC.
Time Read only, the time that the tag be read.
EbdData Read only, if a read operation was embedded in Inventory, then this attribute would contain the read data of another bank. If there is no read operation was embedded or the read operation failed then the attribute would be null.
Rssi Read only, Received Signal Strength Indicator.

EmbededCmdData Class

In the Inventory operation, users can let the reader read data of another bank at the same time. This class is used for specify the details of the read operation.
  
Attribute
Attribute Description
Bank Read only, indicates the bank to be read.
StartAddr Read only, The starting address, in blocks, in bank.
ByteCnt Read only, The number of bytes to read.
  
Constructor

  
public EmbededCmdData(MemBank bank_, UInt32 addr, byte datacnt)
  
Parameters
Parameter Description
bank_ The bank to read when inventory.
addr Read only, The starting address, in blocks, in bank.
datacnt Read only, The number of bytes to read.

AntPower Class

Transmit power setting of a single antenna
  
Attributes
Attribute Description
AntId Read and write, the id of antenna.
ReadPower Read and write
WritePower Read and write
 
Constructor
  
public AntPower(byte aid, UInt16 rpwr, UInt16 wpwr)
  
Parameters
Parameter Description
aid ID of antenna, starting from 1.
rpwr Read power of the antenna, the unit is centi-dBm.
wpwr Write power of antenna,the unit is centi-dBm.

ReaderConfiguration Class

The setting used when permanently saving the parameters of reader.
  
Attributes
Attribute Description
ReaderConfCode Read and write
  
Constructor

  
public ReaderConfiguration(SaveConfCode sccode)
  
Parameters
Parameter Description
sccode SaveConf_Save indicates permanently saving configuration; SaveConf_Erase indicates deleting the configuration permanently saved, reader would use default parameter setting.

BackReadOption Class

This parameter specifies all the details of the asynchronous inventory.
  
Attributes
Attribute Description
ReadDuration Inventory cycle in milliseconds when using common asynchronous inventory mode. If using high-speed asynchronous inventory mode the attribute is meaningless.
ReadInterval The idle interval in milliseconds between two Inventory cycle when using common asynchronous inventory mode. If using high-speed asynchronous inventory mode the attribute is meaningless.
IsFastRead If true, use high speed asynchronous inventory mode, otherwise use common asynchronous inventory mode.
FastReadDutyRation The upper 4 bits must be 0, the lower 4 bits are valid, and the lower 4 bits are used to indicate the proportion of time spent resting during the reader's inventory. If the FastReadDutyRation is 0-9 the proportion is FastReadDutyRation * 5%. If the FastReadDutyRation is 10-15 the proportion is 50%.
FRTMetadata Specifies which metadata information the tag carries when using the high-speed asynchronous inventory mode. If using common asynchronous inventory mode the attribute is meaningless.

BackReadOption.FastReadTagMetaData Class

Specifies which metadata information the tag carries when using the high-speed asynchronous inventory mode.
 
Attributes
Attribute Description
IsReadCnt The read count of the tag.
IsRSSI Received Signal Strength Indication of the tag.
IsAntennaID The antenna ID on which the tag is inventoried.
IsFrequency The Frequency on which the tag is inventoried.
IsTimestamp The time stamp when the tag is inventoried.
IsRFU The Reserved field.
IsEmdData The bank data of the tag, during inventorying reader can read tag data of another bank depending on the EmbededCmdOfInventory parameter.