Basic Operations
This section covers the basic/simple operations that an application would need to be performed on an RFID Reader which includes Inventory and single tag access operations.
Simple Inventory (Continuous)
A simple continuous inventory operation would read all tags in the field of view of all antennas of the connected RFID Reader. It will use NO filters (pre-filters or post-filters) and the start and stop trigger for the inventory would be default, i.e. start immediately when rfidApi.Actions.Inventory.Perform is called, and stop immediately when rfidApi.Actions.Inventory.Stop is called.
// perform simple inventory
rfidApi.Actions.Inventory.Perform();
// Keep getting tags in the ReadNotify event if registered
// stop the inventory
rfidApi.Actions.Inventory.Stop();
Simple Access Operations - On Single Tag
Tag Access operations can be performed on a specific tag or can be applied on tags that match a specific Access-Filter. If no Access-filter is specified the Access Operation will be performed on all Tags in the field of view of chosen Antennas.
This section covers simple tag access operation on a specific tag which could be in the field of view of any of the antenna of the connected RFID Reader.
Read
The application can call method rfidApi.Actions.TagAccess.ReadWait to read data from a specific memory bank.
// Read user memory bank for the given tag ID
string tagId = "1234ABCD00000000000025B1";
TagAccess.ReadAccessParams readAccessParams = new TagAccess.ReadAccessParams();
TagData readAccessTag;
readAccessParams.AccessPassword = 0;
readAccessParams.ByteCount = 8;
readAccessParams.MemoryBank = MEMORY_BANK.MEMORY_BANK_USER;
readAccessParams.ByteOffset = 0;
readAccessTag = rfidApi.Actions.TagAccess.ReadWait(tagId, readAccessParams, null);
Console.WriteLine(readAccessTag.MemoryBank.ToString() + " : " + readAccessTag.MemoryBankData);
Write, Block-Write
The application can call method rfidApi.Actions.TagAccess.WriteWait or rfidApi.Actions.TagAccess.BlockWriteWait to write data to a specific memory bank.
// Write user memory bank data
string tagId = "1234ABCD00000000000025B1";
TagAccess.WriteAccessParams writeAccessParams = new TagAccess.WriteAccessParams();
byte[] writeData = new byte[4] {0x11, 0x22, 0x33, 0x44};
writeAccessParams.AccessPassword = 0;
writeAccessParams.WriteDataLength = (uint)writeData.Length;
writeAccessParams.MemoryBank = MEMORY_BANK.MEMORY_BANK_USER;
writeAccessParams.ByteOffset = 0;
writeAccessParams.WriteData = writeData;
// antenna Info is null – performs on all antenna
rfidApi.Actions.TagAccess.WriteWait(tagId, writeAccessParams, null);
Lock
The application can call method rfidApi.Actions.TagAccess.LockWait to perform lock operation on one or more memory banks with specific privileges.
// Lock the tag
string tagId = "1234ABCD00000000000025B1";
TagAccess.LockAccessParams lockAccessParams = new TagAccess.LockAccessParams();
/* lock now */
lockAccessParams.LockPrivilege[lockAccessParams.UserMemory] = LOCK_PRIVILEGE.LOCK_PRIVILEGE_READ_WRITE;
lockAccessParams.AccessPassword = 0;
rfidApi.Actions.TagAccess.LockWait(tagId, lockAccessParams, null);
Kill
The application can call method rfidApi.Actions.TagAccess.KillWait to kill a tag.
// Kill the tag
string tagId = "1234ABCD00000000000025B1";
TagAccess.KillAccessParams killAccessParams = new TagAccess.KillAccessParams();
killAccessParams.KillPassword = 0;
rfidApi.Actions.TagAccess.KillWait(tagId, killAccessParams, null);
Block-Erase
The application can call RFID_BlockErase to erase the contents of a tag.
// Block Erase
string tagId = "1234ABCD00000000000025B1";
TagAccess.BlockEraseAccessParams blockEraseAccessParams = new TagAccess.BlockEraseAccessParams();
blockEraseAccessParams.AccessPassword = 0;
blockEraseAccessParams.MemoryBank = MEMORY_BANK.MEMORY_BANK_USER; // user memory bank
blockEraseAccessParams.ByteOffset = 0; // start erasing from offset 0
blockEraseAccessParams.ByteCount = 16; // number of bytes to erase
rfidApi.Actions.TagAccess.BlockEraseWait(tagId, blockEraseAccessParams, null);
Block-Permalock
The application can call method rfidApi.Actions.TagAccess.BlockPermalockWait to block permalock a tag. Tags reported as part of Block-Permalock access operation will have TagData.OpCode as ACCESS_OPERATION_BLOCK_PERMALOCK, and TagData.OpStatus indicating the result of the operation; if TagData.OpStatus is ACCESS_SUCCESS, TagData.MemoryBankData will contain the Block-Permalock Mask Data.
// Kill the tag
string tagId = "1234ABCD00000000000025B1";
TagAccess.BlockPermalockAccessParams blockPermalockAccessParams = new TagAccess. BlockPermalockAccessParams ();
byte[] permalockMask = new byte[4] {0xF0, 0x00, 0x00, 0x00};
blockPermalockAccessParams.ReadLock = true;
blockPermalockAccessParams.MemoryBank = MEMORY_BANK.MEMORY_BANK_USER;
blockPermalockAccessParams.ByteOffset = 0;
blockPermalockAccessParams.ByteCount = 0;
blockPermalockAccessParams.Mask = permalockMask;
blockPermalockAccessParams.MaskLength= 4;
rfidApi.Actions.TagAccess.BlockPermalockWait(tagId, blockPermalockAccessParams, null);
Access Operations on specific memory field of Single Tag
The following functions assist in writing to specific memory fields of a specific Tag:
- WriteTagIDWait– This method writes to TagID of tag(s) and adjusts the PC bits according to the length of the TagID. When the TagID is modified, this API ensures that the Tag shall subsequently backscatter the modified EPC, for which it also writes the length of the new or updated (PC + EPC) into the first 5 bits of the Tag’s PC.
- WriteKillPasswordWait- This method writes the kill password of the tag(s).
- WriteAccessPasswordWait-- This method writes the access password of the tag(s).