LLRP Tag Encoding

From RifidiWiki

Jump to: navigation, search

LLRP Tag Encoding Options

LLRP Encode Command

LLRP Encode Command is used to encode a new Tag with the following operations:

Note: The encode command is meant for fully encoding a new tag with all 6 operations below. If one wishes to override any one operation (such as resetting access password or lock permission) please refer to the single shot operations below. Before encoding operation the server performs an access password validation operation, to ensure the tag is an empty tag, or the access password is set appropriate

Order:  operationCode
 1 - LLRPAccessPasswordWrite
 2 - LLRPEPCWrite
 3 - LLRPKillPasswordWrite
 4 - LLRPEPCLock
 5 - LLRPKillPasswordLock
 6 - LLRPAccessPasswordLock

What are EPC, Kill Password, Access Password:

  • EPC is the GEN2 EPC ID for a Tag
  • Kill Password is used to set the password necessary to kill/destroy a tag for future use (by default there is no password (value(0))
  • Access Password is used to perform tag writes such as EPC, Kill Password, Access Password (by default there is no password (value(0))
  • C1G2Write, C1G2Read and C1G2Lock are the LLRP Access Spec operations used


  • Command

llrpencode/{readerID}/{sessionID}/{tag}- Performs all LLRP Encoding operations for a New RFID Tag

  • Example

http://localhost:8111/llrpencode/LLRP_1/1/111122223333444455556666

  • Prerequisites
  1. Ensure the reader session is already in a processing state
  2. Only one tag can be present(This is Not a Bulk encoding operation)
  3. Must be a LLRP reader
  4. Must be a valid readerID and sessionID
  5. tag must be evenly divide by 4 (word in hex) and tag must be able to support length
  6. access password and kill password must be evenly divide by 4 (4 or 8 characters/1 or 2 words) or 0
  7. Only one encoding session per reader can be active at one time
  8. Access Password on tag matches -Dorg.rifidi.llrp.encode.oldaccesspwd set in rifidi-server config - ensures tag hasn't already been fully encoded

Global Settings via Edge_Server_Configuration

Global Properties below need to be set for LLRP encode based on ones requirements

  • Note: All MQTT (if set), timeout tagmask and epctarget always come form Global Variables
  • Note: These are set globally using the Rifidi Edge Configuration Edge_Server_Configuration
-Dorg.rifidi.llrp.encode.targetepc=000000000000000000000000 -   (Hex Value) Sets the EPC Tag Data to perform operation on (Must be even block of 4 charaters and size depends on Tag - typical is 24 characters) - default if not set is 000000000000000000000000
-Dorg.rifidi.llrp.encode.tagmask=000000000000000000000000 -  (Hex Value) Sets the Tag Mask to perform operation on (0 is wildcard match, F is Exact Match) (Must be even block of 4 characters and size depends on Tag - typical is 24 characters) - default if not set is 000000000000000000000000
-Dorg.rifidi.llrp.encode.timeout=5000 - Sets the duration of time to attempt operation (O is infinite until operation occurs, set in milliseconds)
-Dorg.rifidi.llrp.encode.accesspwd=0 - Access Password (Hex Value) (8 Characters or value of 0) - default if not set is 0
-Dorg.rifidi.llrp.encode.oldaccesspwd=0 - Old Access Password (Hex Value) (8 Characters or value of 0) - default if not set is 0 Note: used when setting new access password 
-Dorg.rifidi.llrp.encode.killpwd=0 - Kill Password (Hex Value) (8 Characters or value of 0)  - default if not set is 0
-Dorg.rifidi.llrp.encode.killpwdlockprivilege=Read_Write     - If Set Performs a Kill Password Lock Operation (values can be Read_Write (which Locks), Perma_Lock, Unlock) - default if not set is Read_Write
-Dorg.rifidi.llrp.encode.accesspwdlockprivilege=Read_Write     - If Set Performs a Access Password Lock Operation (values can be Read_Write (which Locks), Perma_Lock, Unlock)  default if not set is Read_Write
-Dorg.rifidi.llrp.encode.epclockprivilege=Read_Write     - If Set Performs a EPC Lock Operation (values can be Read_Write (which Locks), Perma_Lock, Unlock)  -  default if not set is Read_Write
-Dorg.rifidi.llrp.encode.mqttbroker  --   mqtt broker url - optional (if set, received response of encode operation is posted to this queue in asynchronous mode). Mqttqos and mqttclientid must be set too in order to post to queue
-Dorg.rifidi.llrp.encode.mqttqos  -- optional - Quality of service level for mqtt, example: 2
-Dorg.rifidi.llrp.encode.mqttclientid  -- optional - Client id to publish messages on queue


Note: These are optional Global variables for MQTT. If these are set then llrpencode command operations response to sent asynchronously to a topic

  • topic naming convention {readerId}/encode with result of encoding operations
-Dorg.rifidi.llrp.encode.mqttqos=2
-Dorg.rifidi.llrp.encode.mqttbroker=tcp://localhost:1883
-Dorg.rifidi.llrp.encode.mqttclientid=llrpEncodeId

Encode Response

Response: Success

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Success</message>
</response>

Response: Fail

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Fail</message>
   <Description> LLRP Message Returned goes here such as Tag mask and Tag data not matching - such</Description>
</response>

Note: Some types of Fail responses could be

# Reader does not exist:
<response>
   <message>Fail</message>
   <description>Reader with id LLRP_13 does not exist</description>
</response>

# Not a LLRP reader
<response>
   <message>Fail</message>
   <description>Reader with id Front_Door_1 of type Alien is not an LLRP reader type</description>
</response>

# Not a valid session
<response>
   <message>Fail</message>
   <description>Session with id 2 does not exist for reader with id LLRP_1</description>
</response>

# More than one tag (specifies the exact number of tags)
<response>
   <message>Fail</message>
   <description>There are 2 tags in the scope of the reader with id LLRP_1</description>
</response>

# Invalid access spec request
<response>
   <message>Fail</message>
   <description><?xml version="1.0" encoding="UTF-8"?> <llrp:ADD_ACCESSSPEC_RESPONSE xmlns:llrp="http://www.llrp.org/ltk/schema/core/encoding/xml/1.0" Version="1" MessageID="0"> <llrp:LLRPStatus> <llrp:StatusCode>M_FieldError</llrp:StatusCode> <llrp:ErrorDescription>An unkown C1G2 Opsec was added</llrp:ErrorDescription> </llrp:LLRPStatus> </llrp:ADD_ACCESSSPEC_RESPONSE></description>
</response>

# Given access password does not match expected access password
<response>
   <message>Fail</message>
   <description>Given access password does not match expected access password - possibly old password is wrong or tag password has been changed via a previous encoding operation</description>
</response>

# Encoding session already active

Encode Operations Response

Note: These are optional Global variables for MQTT. If these are set then llrpencode command operations response to sent asynchronously to a topic

  • topic naming convention {readerId}/encode with result of encoding operations
-Dorg.rifidi.llrp.encode.mqttqos=2
-Dorg.rifidi.llrp.encode.mqttbroker=tcp://localhost:1883
-Dorg.rifidi.llrp.encode.mqttclientid=llrpEncodeId

Success Message


<encodeMessage>
<status>Success</Status>
</encodeMessage>

Fail Message


<encodeMessage>
<status>Fail</status>
<operationList>
     <operation>LLRPAccessPasswordWrite:Sucess</operation>
     <operation>LLRPEPCWrite:Sucess</operation>
     <operation>LLRPKillPasswordWrite:Sucess</operation>
     <operation>LLRPEPCLock:No_Response_From_Tag</operation>
     <operation>LLRPKillPaswordLock: Success</operation>
     <operation>LLRPAccessPaswordLock: Success</operation>
</operationList>
</encodeMessage>

Full List of Return Failure Codes:


Insufficient_Power 
           
No_Response_From_Tag 
           
Nonspecific_Reader_Error 
           
Nonspecific_Tag_Error 
 
Tag_Memory_Locked_Error 
           
Tag_Memory_Overrun_Error 

LLRP Encode Single Shot Commands

These are used to perform single operations and override Global properties therefore all values must be supplied in request Note: All MQTT (if set), timeout tagmask and epctarget always come form Global Variables

  • Command

/llrpencode/{readerID}/{sessionID}/{operationCode}/{properties}

List of operationCodes

LLRPEPCWrite
LLRPKillPasswordWrite
LLRPAccessPasswordWrite
LLRPEPCLock
LLRPKillPasswordLock
LLRPAccessPasswordLock
LLRPUserMemoryLock
LLRPEPCRead
LLRPAccessPasswordValidate
LLRPKillPasswordRead
LLRPUserMemoryRead
LLRPUserMemoryWrite

Single Shot Encode Operations Response

If MQTT Variables defined Globally (above) then operations result response will be sent to MQTT topic otherwise response is synchronous

  • Topic naming convention: {readerID}/encode



LLRPECWrite

  • Example LLRPECWrite - Used to Write a EPC ID

http://localhost:8111/llrpencode/LLRP_1/1/LLRPEPCWrite/accesspwd=12345678;tag=000000000001111111111268


Success Message


<encodeMessage>
<status>Success</Status>
</encodeMessage>


Response: Fail (on Request Validation)

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Fail</message>
   <Description> LLRP Message Returned goes here such as Tag mask and Tag data not matching - such</Description>
</response>

Note: Some types of Fail responses could be
# More than one tag
# Not a LLLRP reader
# Not a valid session
# Invalid access spec request
# Encoding session already active

Response: Fail (on Encode Operation Result) - Note: if Async configured this response will be in MQTT Topic

<encodeMessage>
<status>Fail</status>
<operationList>
     <operation>LLRPEPCLock:No_Response_From_Tag</operation>
</operationList>
</encodeMessage>

Full List of Encode Operations Failure Codes:


Insufficient_Power 
           
No_Response_From_Tag 
           
Nonspecific_Reader_Error 
           
Nonspecific_Tag_Error 
 
Tag_Memory_Locked_Error 
           
Tag_Memory_Overrun_Error 

LLRPKillPasswordWrite

  • Example LLRPKillPasswordWrite - Used to Write a Kill Password

http://localhost:8111/llrpencode/LLRP_1/1/LLRPKillPasswordWrite/accesspwd=12345678;killpwd=87654321

Success Message


<encodeMessage>
<status>Success</Status>
</encodeMessage>


Response: Fail (on Request Validation)

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Fail</message>
   <Description> LLRP Message Returned goes here such as Tag mask and Tag data not matching - such</Description>
</response>

Note: Some types of Fail responses could be
# More than one tag
# Not a LLLRP reader
# Not a valid session
# Invalid access spec request
# Encoding session already active

Response: Fail (on Encode Operation Result) - Note: if Async configured this response will be in MQTT Topic

<encodeMessage>
<status>Fail</status>
<operationList>
     <operation>LLRPEPCLock:No_Response_From_Tag</operation>
</operationList>
</encodeMessage>

Full List of Encode Operations Failure Codes:


Insufficient_Power 
           
No_Response_From_Tag 
           
Nonspecific_Reader_Error 
           
Nonspecific_Tag_Error 
 
Tag_Memory_Locked_Error 
           
Tag_Memory_Overrun_Error 

LLRPAccessPasswordWrite

  • Example LLRPAccessPasswordWrite - Used to Write a Access Password

http://localhost:8111/llrpencode/LLRP_1/1/LLRPAccessPasswordWrite/oldaccesspwd=12345678;accesspwd=98765432


Success Message


<encodeMessage>
<status>Success</Status>
</encodeMessage>

Fail Message

<encodeMessage>
<status>Fail</status>
<operationList>
     <operation>LLRPEPCLock:No_Response_From_Tag</operation>
</operationList>
</encodeMessage>

Full List of Encode Operations Failure Codes:


Insufficient_Power 
           
No_Response_From_Tag 
           
Nonspecific_Reader_Error 
           
Nonspecific_Tag_Error 
 
Tag_Memory_Locked_Error 
           
Tag_Memory_Overrun_Error 

LLRPEPCLock

  • Example LLRPEPCLock - Set EPC Lock Priveledge

http://localhost:8111/llrpencode/LLRP_1/1/LLRPEPCLock/accesspwd=98765432;privilege=Read_Write

Success Message


<encodeMessage>
<status>Success</Status>
</encodeMessage>


Response: Fail (on Request Validation)

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Fail</message>
   <Description> LLRP Message Returned goes here such as Tag mask and Tag data not matching - such</Description>
</response>

Note: Some types of Fail responses could be
# More than one tag
# Not a LLLRP reader
# Not a valid session
# Invalid access spec request
# Encoding session already active

Response: Fail (on Encode Operation Result) - Note: if Async configured this response will be in MQTT Topic

<encodeMessage>
<status>Fail</status>
<operationList>
     <operation>LLRPEPCLock:No_Response_From_Tag</operation>
</operationList>
</encodeMessage>

Full List of Encode Operations Failure Codes:


Insufficient_Power 
           
No_Response_From_Tag 
           
Nonspecific_Reader_Error 
           
Nonspecific_Tag_Error 
 
Tag_Memory_Locked_Error 
           
Tag_Memory_Overrun_Error 

LLRPKillPasswordLock

  • Example LLRPKillPasswordLock - Set Kill Password Lock Privilege

http://localhost:8111/llrpencode/LLRP_1/1/LLRPKillPasswordLock/accesspwd=98765432;privilege=Read_Write

Success Message


<encodeMessage>
<status>Success</Status>
</encodeMessage>


Response: Fail (on Request Validation)

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Fail</message>
   <Description> LLRP Message Returned goes here such as Tag mask and Tag data not matching - such</Description>
</response>

Note: Some types of Fail responses could be
# More than one tag
# Not a LLLRP reader
# Not a valid session
# Invalid access spec request
# Encoding session already active

Response: Fail (on Encode Operation Result) - Note: if Async configured this response will be in MQTT Topic

<encodeMessage>
<status>Fail</status>
<operationList>
     <operation>LLRPEPCLock:No_Response_From_Tag</operation>
</operationList>
</encodeMessage>

Full List of Encode Operations Failure Codes:


Insufficient_Power 
           
No_Response_From_Tag 
           
Nonspecific_Reader_Error 
           
Nonspecific_Tag_Error 
 
Tag_Memory_Locked_Error 
           
Tag_Memory_Overrun_Error 

LLRPAccessPasswordLock

  • Example LLRPAccessPasswordLock - Set Access Password Lock Privilege

http://localhost:8111/llrpencode/LLRP_1/1/LLRPAccessPasswordLock/accesspwd=98765432;privilege=Read_Write

Success Message


<encodeMessage>
<status>Success</Status>
</encodeMessage>

Response: Fail (on Request Validation)

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Fail</message>
   <Description> LLRP Message Returned goes here such as Tag mask and Tag data not matching - such</Description>
</response>

Note: Some types of Fail responses could be
# More than one tag
# Not a LLLRP reader
# Not a valid session
# Invalid access spec request
# Encoding session already active

Response: Fail (on Encode Operation Result) - Note: if Async configured this response will be in MQTT Topic

<encodeMessage>
<status>Fail</status>
<operationList>
     <operation>LLRPEPCLock:No_Response_From_Tag</operation>
</operationList>
</encodeMessage>

Full List of Encode Operations Failure Codes:


Insufficient_Power 
           
No_Response_From_Tag 
           
Nonspecific_Reader_Error 
           
Nonspecific_Tag_Error 
 
Tag_Memory_Locked_Error 
           
Tag_Memory_Overrun_Error 

LLRPUserMemoryLock coming in Rifidi 3.2

  • Example LLRPUserMemoryLock- Set user memory Lock Privilege

http://localhost:8111/llrpencode/LLRP_1/1/LLRPUserMemoryLock/accesspwd=98765432;privilege=Read_Write

Success Message


<encodeMessage>
<status>Success</Status>
</encodeMessage>


Response: Fail (on Request Validation)

<?xml version="1.0" encoding="UTF-8"?>
<response>
   <message>Fail</message>
   <Description> LLRP Message Returned goes here such as Tag mask and Tag data not matching - such</Description>
</response>

Note: Some types of Fail responses could be
# More than one tag
# Not a LLLRP reader
# Not a valid session
# Invalid access spec request
# Encoding session already active

Response: Fail (on Encode Operation Result) - Note: if Async configured this response will be in MQTT Topic

<encodeMessage>
<status>Fail</status>
<operationList>
     <operation>LLRPUserMemoryLock:Nonspecific_Tag_Error</operation>
</operationList>
</encodeMessage>

Full List of Encode Operations Failure Codes:


Insufficient_Power 
           
No_Response_From_Tag 
           
Nonspecific_Reader_Error 
           
Nonspecific_Tag_Error 
 
Tag_Memory_Locked_Error 
           
Tag_Memory_Overrun_Error 

LLRPEPCRead - Reads EPC (with default wordCount 6 ) as of Rifidi 3.2

  • Example LLRPEPCRead - Reads EPC (with default wordCount)

wordCount parameter means how many blocks of 4 characters conform the EPC. Default wordCount value is 6, witch is 24 charters or 96 bit, which is typical for many tags.


http://localhost:8111/llrpencode/LLRP_1/1/LLRPEPCRead/accesspwd=12345678


Success Message


<encodeMessage>
<status>Success</Status>
</encodeMessage>

Response: Fail (on Encode Operation Result) - Note: if Async configured this response will be in MQTT Topic

<encodeMessage>
<status>Fail</status>
<operationList>
     <operation>LLRPEPCLock:No_Response_From_Tag</operation>
</operationList>
</encodeMessage>

Full List of Encode Operations Failure Codes:


Insufficient_Power 
           
No_Response_From_Tag 
           
Nonspecific_Reader_Error 
           
Nonspecific_Tag_Error 
 
Tag_Memory_Locked_Error 
           
Tag_Memory_Overrun_Error 

LLRPEPCRead - Reads EPC (overriding wordCount) as of Rifidi 3.2

  • Example LLRPEPCRead - Reads EPC (overriding wordCount)

http://localhost:8111/llrpencode/LLRP_1/1/LLRPEPCRead/accesspwd=12345678;wordCount=6

wordCount parameter means how many blocks of 4 characters conform the EPC. Default wordCount value is 6, witch is 24 charters or 96 bit, which is typical for many tags. Setting this parameter allows one to override the default wordCount value of 6

If provided access password is correct, the EPC is returned:

<encodeMessage>
  <status>Success</status>
  <data>111122223333444455556608</data>
</encodeMessage>

If access password is wrong, returns a fail message:

<encodeMessage>
  <status>Fail</status>
  <data/>
  <operationList>
    <operation>LLRPEPCRead:Nonspecific_Reader_Error</operation>
  </operationList>
</encodeMessage>

LLRPAccessPasswordValidate as of Rifidi 3.2

  • Example LLRPAccessPasswordValidate - Validate access password

http://localhost:8111/llrpencode/LLRP_1/1/LLRPAccessPasswordValidate/accesspwd=12345678

If provided access password is correct, returns success:

<encodeMessage>
  <status>Success</status>
</encodeMessage>

If access password is wrong, returns a fail message:

<encodeMessage>
  <status>Fail</status>
  <data/>
  <operationList>
    <operation>LLRPAccessPasswordValidate:Nonspecific_Reader_Error</operation>
  </operationList>
</encodeMessage>

LLRPKillPasswordRead as of Rifidi 3.2

  • Example LLRPKillPasswordRead - Reads kill password

http://localhost:8111/llrpencode/LLRP_1/1/LLRPKillPasswordRead/accesspwd=12345678

If provided access password is correct, the kill password is returned:

<encodeMessage>
  <status>Success</status>
  <data>56783456</data>
</encodeMessage>

If access password is wrong, returns a fail message:

<encodeMessage>
  <status>Fail</status>
  <data/>
  <operationList>
    <operation>LLRPKillPasswordRead:Nonspecific_Reader_Error</operation>
  </operationList>
</encodeMessage>

LLRPUserMemoryRead (with default wordCount) as of Rifidi 3.2

  • Example LLRPUserMemoryRead - Reads user memory

http://localhost:8111/llrpencode/LLRP_1/1/LLRPUserMemoryRead/accesspwd=12345678

wordCount parameter means how many blocks of 4 characters conform the user memory. Default wordCount value for user memory is 2, witch is 8 charters.


If provided access password is correct, the user memory data is returned:

<encodeMessage>
  <status>Success</status>
  <data>56783456</data>
</encodeMessage>

If access password is wrong, returns a fail message:

<encodeMessage>
  <status>Fail</status>
  <data/>
  <operationList>
    <operation>LLRPUserMemoryRead:Nonspecific_Tag_Error</operation>
  </operationList>
</encodeMessage>

LLRPUserMemoryRead (overriding wordCount) as of Rifidi 3.2

  • Example LLRPUserMemoryRead - Reads user memory

http://localhost:8111/llrpencode/LLRP_1/1/LLRPUserMemoryRead/accesspwd=12345678;wordCount=6

wordCount parameter means how many blocks of 4 characters conform the user memory.


If provided access password is correct, the user memory data is returned:

<encodeMessage>
  <status>Success</status>
  <data>56783456</data>
</encodeMessage>

If access password is wrong, returns a fail message:

<encodeMessage>
  <status>Fail</status>
  <data/>
  <operationList>
    <operation>LLRPUserMemoryRead:Nonspecific_Tag_Error</operation>
  </operationList>
</encodeMessage>

LLRPUserMemoryWrite as of Rifidi 3.2

  • Example LLRPUserMemoryWrite - Writes to user memory

http://localhost:8111/llrpencode/LLRP_1/1/LLRPUserMemoryWrite/accesspwd=12345678;data=AAAABBBB

data parameter is the data to be written in user memory.

If provided access password is correct, the user memory data is written:

<encodeMessage>
  <status>Success</status>
</encodeMessage>

If access password is wrong, returns a fail message:

<encodeMessage>
  <status>Fail</status>
  <data/>
  <operationList>
    <operation>LLRPUserMemoryWrite:Nonspecific_Reader_Error</operation>
  </operationList>
</encodeMessage>
Personal tools