Gen2.writedata, Gen2.lock, Gen2.lockaction class – ThingMagic Mercury API v1.23.0 User Manual

Page 45: Gen2.writedata 45 gen2.lock 45, For writing to specific locations in individual

Advertising
background image

Advanced Tag Operations

Level 2 API

45

Gen2.WriteData

Writes the specified data to the tag memory location specified by the Memory Bank and
location parameters.

Note

Currently limited to writing 123 words of data per WriteData invocation.

By default this method will perform a word by word write but it can be made to attempt a

Gen2.BlockWrite

by setting

/reader/gen2/writeMode

= Gen2.WriteMode.BLOCK_ONLY or

BLOCK_FALLBACK.

Gen2.Lock

Sends a command to a tag to lock and/or unlock segments of tag memory. The lock
operation to perform is represented as an instance of the

Gen2.LockAction Class

.

In order to lock Gen2 Memory the desired password must first be written to Reserved
Memory. Once the Access password has been written the desired memory can be locked
using the AccessPassword. This can be done by either:



Set

/reader/gen2/accessPassword

to the correct value and specify 0 in the Gen2.Lock

instance’s password field



Set the password parameter of the Gen2.Lock instance to the correct password.

Gen2.LockAction Class

Instances of this class represent a set of lock and unlock actions on a Gen2 tag. It is
based on the LLRP syntax for C1G2Lock.

There are 5 lockable fields within the tag memory (LLRP calls these “DataFields”): EPC,
TID, User, Kill Password and Access Password. Each field may be assigned one of 4
possible lock states (LLRP calls these “Privileges”):



Lock: Writes not allowed. If the field is a password, then reads aren’t allowed, either.



Unlock: Reads and Writes allowed.



Permalock: Permanently locked – attempts to Unlock will now fail.



Permaunlock: Permanently unlocked – attempts to Lock will now fail.

Gen2.LockAction encapsulates a field and a lock state. Predefined constants are
provided for every possible combination of field and lock state.



Gen2.LockAction.KILL_LOCK



Gen2.LockAction.KILL_UNLOCK

Advertising