-
12.9 Support Dot Net Compact Framework
R1000ReaderCF.dll is a C# wrap of Native C/C++ DLL of RFID18k6cReader.dll. It provides APIs for Dot
Net Compact Framework programmer to control the RFID Reader.
12.9.1 Class “R1000Reader”
This is main class instantiated by applications. It provides properties and methods for accessing the
RFID Reader. The methods in R1000ReaderCF have the same name as their Native implementation.
12.9.2 Programming Model
The first is add reference of R1000ReaderCF.dll to your project.
C# example:
using Unitech.R1000.Reader;
using Unitech.R1000.Reader.Constants;
using Unitech.R1000.Reader.Structures;
//Create and Initialize the RFID Library
String strVersion = String.Empty;
R1000Reader.RFIDCreate(ref strVersion);
//Open the RFID Reader
R1000Reader.RFIDOpen(0);
//Inventory & retrieve the tag's epc
RFID_INVENTORY stInventory = new RFID_INVENTORY();
ACCESS_STATUS stAccessStatus = new ACCESS_STATUS();
//operation in blocking mode
R1000Reader.RFIDInventory(stInventory, ref stAccessStatus, true, 3000);
if (stAccessStatus .dwStatus == 0 && stAccessStatus.dwErrorCode == 0)
{
for (int i = 0; i < stAccessStatus.unAntennas; i++)
{
ANTENNA_STATUS stAntennaStatus = new ANTENNA_STATUS();
R1000Reader.RFIDGetAntennaStatus(i, ref stAntennaStatus);
for (int j = 0; j < stAntennaStatus.unCount; j++)
{
ACCESS_DATA accessData = new ACCESS_DATA();
UInt32 nRet = R1000Reader.RFIDGetAccessData(i, j, ref accessData);
if (nRet == 1 && accessData.unEPCLength > 0)
{
//Get EPC from accessData.pnEPC;
}
}
}
}
//Close the RFID Reader
R1000Reader.RFIDClose(0);
//Destroy RFID Library
R1000Reader.RFIDDestroy();