ModuleAPI C# Version Developer's Guide
Lock Tag

LockTag Method

Lock the tag's storage areas
 
Method Signature
  
public abstract void LockTag(ModuleTech.TagFilter target, ModuleTech.TagLockAction action)
  
Parameters
Parameter Description
target Tag filter, set as null if it is not necessary.
action The action of lock.
  
Example
If there is a tag whose TID bank starts with 0x4321123 and its access password is 0x33332222. This example temporarily locks EPC bank, unlock user bank and permanently locks the access password.
  
byte[] fdata = ByteFormat.FromHex("4321123");
Gen2TagFilter filter = new Gen2TagFilter(fdata.Length*8, fdata ,ModuleTech.Gen2.MemBank.TID, 0, false);
string accesspwdstr = "33332222";
uint passwd = uint.Parse(accesspwdstr, System.Globalization.NumberStyles.AllowHexSpecifier);
rdr.ParamSet("AccessPassword", passwd);
Gen2LockAct [] acts = new Gen2LockAct[3];
acts[0] = Gen2LockAct.EPC_LOCK;
acts[1] = Gen2LockAct.TID_UNLOCK;
acts[2] = Gen2LockAct.ACCESS_PERMALOCK;
Gen2LockAction lockact = new Gen2LockAction(acts);
rdr.LockTag(filter, lockact);