Difference between revisions of "Edge LLRP Reader Management"
From RifidiWiki
(→LLRP Set Operation example) |
(→LLRP Set Operation example) |
||
| Line 5: | Line 5: | ||
==LLRP Set Operation example== | ==LLRP Set Operation example== | ||
*llrpmessage/{readerID}/{sessionID} - Dynamically (one shot) configures a LLRP reader with an LLRP message (LLRP XML Config per LLRP Specification - http://www.gs1.org/gsmp/kc/epcglobal/llrp) | *llrpmessage/{readerID}/{sessionID} - Dynamically (one shot) configures a LLRP reader with an LLRP message (LLRP XML Config per LLRP Specification - http://www.gs1.org/gsmp/kc/epcglobal/llrp) | ||
| − | *Note: Only works via HTTP POST operation as LLRP Message is XML and can exceed Get/URL length limitations ( | + | *Note: Only works via HTTP POST operation as LLRP Message is XML and can exceed Get/URL length limitations (2083 Characters) |
<br> | <br> | ||
Some Examples: | Some Examples: | ||
Revision as of 18:25, 28 January 2016
Contents
Edge LLRP Reader Management
These are the REST commands specific for managing LLRP readers with Rifidi
LLRP Set Operation example
- llrpmessage/{readerID}/{sessionID} - Dynamically (one shot) configures a LLRP reader with an LLRP message (LLRP XML Config per LLRP Specification - http://www.gs1.org/gsmp/kc/epcglobal/llrp)
- Note: Only works via HTTP POST operation as LLRP Message is XML and can exceed Get/URL length limitations (2083 Characters)
Some Examples:
- Java - Link to example HTTP Post Client calling llrpmessage command - https://transcends.svn.cloudforge.com/rifidi/rifidi/trunk/org.rifidi.edge.rest/src/org/rifidi/edge/rest/test/MyHttpTestClient.java
- Curl:
curl -H "Content-Type: text/xml" -d @Desktop/default.xml -X POST http://localhost:8111/llrpmessage/LLRP_1/1 Note: The LLRP XML operation is defined in the file (default.xml) in this case
Example LLRP Message (Setting Reader Configuration) -
- Note: Any Valid LLRP Message can be provided - LLRP Commanded can be used to generate and validate the XML - https://code.google.com/p/fosstrak/wiki/LlrpMain
<llrp:SET_READER_CONFIG xmlns:llrp="http://www.llrp.org/ltk/schema/core/encoding/xml/1.0" Version="1" MessageID="0">
<llrp:ResetToFactoryDefault>0</llrp:ResetToFactoryDefault>
<llrp:ReaderEventNotificationSpec>
<llrp:EventNotificationState>
<llrp:EventType>GPI_Event</llrp:EventType>
<llrp:NotificationState>1</llrp:NotificationState>
</llrp:EventNotificationState>
</llrp:ReaderEventNotificationSpec>
<llrp:ROReportSpec>
<llrp:ROReportTrigger>None</llrp:ROReportTrigger>
<llrp:N>0</llrp:N>
<llrp:TagReportContentSelector>
<llrp:EnableROSpecID>1</llrp:EnableROSpecID>
<llrp:EnableSpecIndex>0</llrp:EnableSpecIndex>
<llrp:EnableInventoryParameterSpecID>0</llrp:EnableInventoryParameterSpecID>
<llrp:EnableAntennaID>1</llrp:EnableAntennaID>
<llrp:EnableChannelIndex>0</llrp:EnableChannelIndex>
<llrp:EnablePeakRSSI>1</llrp:EnablePeakRSSI>
<llrp:EnableFirstSeenTimestamp>1</llrp:EnableFirstSeenTimestamp>
<llrp:EnableLastSeenTimestamp>1</llrp:EnableLastSeenTimestamp>
<llrp:EnableTagSeenCount>1</llrp:EnableTagSeenCount>
<llrp:EnableAccessSpecID>1</llrp:EnableAccessSpecID>
<llrp:C1G2EPCMemorySelector>
<llrp:EnableCRC>0</llrp:EnableCRC>
<llrp:EnablePCBits>0</llrp:EnablePCBits>
</llrp:C1G2EPCMemorySelector>
</llrp:TagReportContentSelector>
</llrp:ROReportSpec>
<llrp:AccessReportSpec>
<llrp:AccessReportTrigger>Whenever_ROReport_Is_Generated</llrp:AccessReportTrigger>
</llrp:AccessReportSpec>
<llrp:GPIPortCurrentState>
<llrp:GPIPortNum>1</llrp:GPIPortNum>
<llrp:Config>1</llrp:Config>
<llrp:State>Low</llrp:State>
</llrp:GPIPortCurrentState>
<llrp:GPIPortCurrentState>
<llrp:GPIPortNum>2</llrp:GPIPortNum>
<llrp:Config>1</llrp:Config>
<llrp:State>Low</llrp:State>
</llrp:GPIPortCurrentState>
<llrp:GPIPortCurrentState>
<llrp:GPIPortNum>3</llrp:GPIPortNum>
<llrp:Config>1</llrp:Config>
<llrp:State>Low</llrp:State>
</llrp:GPIPortCurrentState>
- posting the example LLRP Message using MyHttpTestClient
Response: Success
<?xml version="1.0" encoding="UTF-8"?>
<llrp:SET_READER_CONFIG_RESPONSE xmlns:llrp="http://www.llrp.org/ltk/schema/core/encoding/xml/1.0" Version="1" MessageID="0">
<llrp:LLRPStatus>
<llrp:StatusCode>M_Success</llrp:StatusCode>
<llrp:ErrorDescription />
</llrp:LLRPStatus>
</llrp:SET_READER_CONFIG_RESPONSE>
- posting the example LLRP Message using MyHttpTestClient, setting wrong reader id
Response: Fail
<?xml version="1.0" encoding="UTF-8"?> <response> <message>Fail</message> <description>ReaderID is missing or invalid</description> </response>
- posting the example LLRP Message using MyHttpTestClient, setting wrong session id
Response: Fail
<?xml version="1.0" encoding="UTF-8"?> <response> <message>Fail</message> <description>SessionID is missing or invalid</description> </response>
- posting the example LLRP Message using MyHttpTestClient, setting wrong entry in xml message, for example setting <llrp:EnableCRC>xxAB1</llrp:EnableCRC>
Response: Fail
LTK XML message can not be validated against schema org/llrp/ltk/llrp-1x0.xsd
<?xml version="1.0" encoding="UTF-8"?>
<llrp:SET_READER_CONFIG xmlns:llrp="http://www.llrp.org/ltk/schema/core/encoding/xml/1.0" Version="1" MessageID="0">
<llrp:ResetToFactoryDefault>0</llrp:ResetToFactoryDefault>
<llrp:ReaderEventNotificationSpec>
<llrp:EventNotificationState>
<llrp:EventType>GPI_Event</llrp:EventType>
<llrp:NotificationState>1</llrp:NotificationState>
</llrp:EventNotificationState>
</llrp:ReaderEventNotificationSpec>
<llrp:ROReportSpec>
<llrp:ROReportTrigger>None</llrp:ROReportTrigger>
<llrp:N>0</llrp:N>
<llrp:TagReportContentSelector>
<llrp:EnableROSpecID>1</llrp:EnableROSpecID>
<llrp:EnableSpecIndex>0</llrp:EnableSpecIndex>
<llrp:EnableInventoryParameterSpecID>0</llrp:EnableInventoryParameterSpecID>
<llrp:EnableAntennaID>1</llrp:EnableAntennaID>
<llrp:EnableChannelIndex>0</llrp:EnableChannelIndex>
<llrp:EnablePeakRSSI>1</llrp:EnablePeakRSSI>
<llrp:EnableFirstSeenTimestamp>1</llrp:EnableFirstSeenTimestamp>
<llrp:EnableLastSeenTimestamp>1</llrp:EnableLastSeenTimestamp>
<llrp:EnableTagSeenCount>1</llrp:EnableTagSeenCount>
<llrp:EnableAccessSpecID>1</llrp:EnableAccessSpecID>
<llrp:C1G2EPCMemorySelector>
<llrp:EnableCRC>xxAB1</llrp:EnableCRC>
<llrp:EnablePCBits>0</llrp:EnablePCBits>
</llrp:C1G2EPCMemorySelector>
</llrp:TagReportContentSelector>
</llrp:ROReportSpec>
<llrp:AccessReportSpec>
<llrp:AccessReportTrigger>Whenever_ROReport_Is_Generated</llrp:AccessReportTrigger>
</llrp:AccessReportSpec>
<llrp:GPIPortCurrentState>
<llrp:GPIPortNum>1</llrp:GPIPortNum>
<llrp:Config>1</llrp:Config>
<llrp:State>Low</llrp:State>
</llrp:GPIPortCurrentState>
<llrp:GPIPortCurrentState>
<llrp:GPIPortNum>2</llrp:GPIPortNum>
<llrp:Config>1</llrp:Config>
<llrp:State>Low</llrp:State>
</llrp:GPIPortCurrentState>
<llrp:GPIPortCurrentState>
<llrp:GPIPortNum>3</llrp:GPIPortNum>
<llrp:Config>1</llrp:Config>
<llrp:State>Low</llrp:State>
</llrp:GPIPortCurrentState>
<llrp:EventsAndReports>
<llrp:HoldEventsAndReportsUponReconnect>0</llrp:HoldEventsAndReportsUponReconnect>
</llrp:EventsAndReports>
</llrp:SET_READER_CONFIG>
because cvc-datatype-valid.1.2.1: 'xxAB1' is not a valid value for 'boolean'.
LLRP Get Reader Configuration
Available starting in Rifidi 3.1.1
- llrpgetreaderconfig/{readerID}/{sessionID} -Returns the current LLRP Reader configuration for a given reader id - Specification - http://www.gs1.org/gsmp/kc/epcglobal/llrp)
Note: Applies to LLRP sesnortypes only. Helpful for troubleshooting to determine the current LLRP Reader configuration example
Response
<?xml version="1.0" encoding="UTF-8"?>
<llrp:GET_READER_CONFIG_RESPONSE xmlns:llrp="http://www.llrp.org/ltk/schema/core/encoding/xml/1.0" Version="1" MessageID="0">
<llrp:LLRPStatus>
<llrp:StatusCode>M_Success</llrp:StatusCode>
<llrp:ErrorDescription>Success</llrp:ErrorDescription>
</llrp:LLRPStatus>
<llrp:Identification>
<llrp:IDType>MAC_Address</llrp:IDType>
<llrp:ReaderID>000000000000</llrp:ReaderID>
</llrp:Identification>
<llrp:AntennaProperties>
<llrp:AntennaConnected>1</llrp:AntennaConnected>
<llrp:AntennaID>1</llrp:AntennaID>
<llrp:AntennaGain>0</llrp:AntennaGain>
</llrp:AntennaProperties>
<llrp:AntennaConfiguration>
<llrp:AntennaID>1</llrp:AntennaID>
<llrp:RFReceiver>
<llrp:ReceiverSensitivity>0</llrp:ReceiverSensitivity>
</llrp:RFReceiver>
<llrp:RFTransmitter>
<llrp:HopTableID>0</llrp:HopTableID>
<llrp:ChannelIndex>0</llrp:ChannelIndex>
<llrp:TransmitPower>0</llrp:TransmitPower>
</llrp:RFTransmitter>
</llrp:AntennaConfiguration>
<llrp:ReaderEventNotificationSpec>
<llrp:EventNotificationState>
<llrp:EventType>Upon_Hopping_To_Next_Channel</llrp:EventType>
<llrp:NotificationState>0</llrp:NotificationState>
</llrp:EventNotificationState>
<llrp:EventNotificationState>
<llrp:EventType>GPI_Event</llrp:EventType>
<llrp:NotificationState>1</llrp:NotificationState>
</llrp:EventNotificationState>
<llrp:EventNotificationState>
<llrp:EventType>ROSpec_Event</llrp:EventType>
<llrp:NotificationState>0</llrp:NotificationState>
</llrp:EventNotificationState>
<llrp:EventNotificationState>
<llrp:EventType>Report_Buffer_Fill_Warning</llrp:EventType>
<llrp:NotificationState>0</llrp:NotificationState>
</llrp:EventNotificationState>
<llrp:EventNotificationState>
<llrp:EventType>Reader_Exception_Event</llrp:EventType>
<llrp:NotificationState>0</llrp:NotificationState>
</llrp:EventNotificationState>
<llrp:EventNotificationState>
<llrp:EventType>RFSurvey_Event</llrp:EventType>
<llrp:NotificationState>0</llrp:NotificationState>
</llrp:EventNotificationState>
<llrp:EventNotificationState>
<llrp:EventType>AISpec_Event</llrp:EventType>
<llrp:NotificationState>0</llrp:NotificationState>
</llrp:EventNotificationState>
<llrp:EventNotificationState>
<llrp:EventType>AISpec_Event_With_Details</llrp:EventType>
<llrp:NotificationState>0</llrp:NotificationState>
</llrp:EventNotificationState>
<llrp:EventNotificationState>
<llrp:EventType>Antenna_Event</llrp:EventType>
<llrp:NotificationState>0</llrp:NotificationState>
</llrp:EventNotificationState>
</llrp:ReaderEventNotificationSpec>
<llrp:ROReportSpec>
<llrp:ROReportTrigger>None</llrp:ROReportTrigger>
<llrp:N>0</llrp:N>
<llrp:TagReportContentSelector>
<llrp:EnableROSpecID>1</llrp:EnableROSpecID>
<llrp:EnableSpecIndex>0</llrp:EnableSpecIndex>
<llrp:EnableInventoryParameterSpecID>0</llrp:EnableInventoryParameterSpecID>
<llrp:EnableAntennaID>0</llrp:EnableAntennaID>
<llrp:EnableChannelIndex>0</llrp:EnableChannelIndex>
<llrp:EnablePeakRSSI>0</llrp:EnablePeakRSSI>
<llrp:EnableFirstSeenTimestamp>0</llrp:EnableFirstSeenTimestamp>
<llrp:EnableLastSeenTimestamp>0</llrp:EnableLastSeenTimestamp>
<llrp:EnableTagSeenCount>0</llrp:EnableTagSeenCount>
<llrp:EnableAccessSpecID>0</llrp:EnableAccessSpecID>
<llrp:C1G2EPCMemorySelector>
<llrp:EnableCRC>0</llrp:EnableCRC>
<llrp:EnablePCBits>0</llrp:EnablePCBits>
</llrp:C1G2EPCMemorySelector>
</llrp:TagReportContentSelector>
</llrp:ROReportSpec>
<llrp:AccessReportSpec>
<llrp:AccessReportTrigger>Whenever_ROReport_Is_Generated</llrp:AccessReportTrigger>
</llrp:AccessReportSpec>
<llrp:LLRPConfigurationStateValue>
<llrp:LLRPConfigurationStateValue>19</llrp:LLRPConfigurationStateValue>
</llrp:LLRPConfigurationStateValue>
<llrp:KeepaliveSpec>
<llrp:KeepaliveTriggerType>Null</llrp:KeepaliveTriggerType>
<llrp:PeriodicTriggerValue>0</llrp:PeriodicTriggerValue>
</llrp:KeepaliveSpec>
<llrp:GPIPortCurrentState>
<llrp:GPIPortNum>1</llrp:GPIPortNum>
<llrp:Config>1</llrp:Config>
<llrp:State>Low</llrp:State>
</llrp:GPIPortCurrentState>
<llrp:GPIPortCurrentState>
<llrp:GPIPortNum>2</llrp:GPIPortNum>
<llrp:Config>1</llrp:Config>
<llrp:State>Low</llrp:State>
</llrp:GPIPortCurrentState>
<llrp:GPIPortCurrentState>
<llrp:GPIPortNum>3</llrp:GPIPortNum>
<llrp:Config>1</llrp:Config>
<llrp:State>Low</llrp:State>
</llrp:GPIPortCurrentState>
<llrp:GPIPortCurrentState>
<llrp:GPIPortNum>4</llrp:GPIPortNum>
<llrp:Config>1</llrp:Config>
<llrp:State>Low</llrp:State>
</llrp:GPIPortCurrentState>
<llrp:GPOWriteData>
<llrp:GPOPortNumber>1</llrp:GPOPortNumber>
<llrp:GPOData>0</llrp:GPOData>
</llrp:GPOWriteData>
<llrp:GPOWriteData>
<llrp:GPOPortNumber>2</llrp:GPOPortNumber>
<llrp:GPOData>0</llrp:GPOData>
</llrp:GPOWriteData>
<llrp:GPOWriteData>
<llrp:GPOPortNumber>3</llrp:GPOPortNumber>
<llrp:GPOData>0</llrp:GPOData>
</llrp:GPOWriteData>
<llrp:GPOWriteData>
<llrp:GPOPortNumber>4</llrp:GPOPortNumber>
<llrp:GPOData>0</llrp:GPOData>
</llrp:GPOWriteData>
<llrp:EventsAndReports>
<llrp:HoldEventsAndReportsUponReconnect>0</llrp:HoldEventsAndReportsUponReconnect>
</llrp:EventsAndReports>
</llrp:GET_READER_CONFIG_RESPONSE>
LLRP Get ROSpec
Available starting in Rifidi 3.1.1
- llrpgetrospecs/{readerID}/{sessionID} -Returns the current LLRP ROSpec configuration for a given reader id - Specification - http://www.gs1.org/gsmp/kc/epcglobal/llrp)
Note: Applies to only LLRP sensortypes - Helpful for troubleshooting to determine the current LLRP ROSpec configuration example
<?xml version="1.0" encoding="UTF-8"?>
<llrp:GET_ROSPECS_RESPONSE xmlns:llrp="http://www.llrp.org/ltk/schema/core/encoding/xml/1.0" Version="1" MessageID="0">
<llrp:LLRPStatus>
<llrp:StatusCode>M_Success</llrp:StatusCode>
<llrp:ErrorDescription>sucess</llrp:ErrorDescription>
</llrp:LLRPStatus>
<llrp:ROSpec>
<llrp:ROSpecID>1</llrp:ROSpecID>
<llrp:Priority>0</llrp:Priority>
<llrp:CurrentState>Active</llrp:CurrentState>
<llrp:ROBoundarySpec>
<llrp:ROSpecStartTrigger>
<llrp:ROSpecStartTriggerType>Immediate</llrp:ROSpecStartTriggerType>
</llrp:ROSpecStartTrigger>
<llrp:ROSpecStopTrigger>
<llrp:ROSpecStopTriggerType>Null</llrp:ROSpecStopTriggerType>
<llrp:DurationTriggerValue>0</llrp:DurationTriggerValue>
</llrp:ROSpecStopTrigger>
</llrp:ROBoundarySpec>
<llrp:AISpec>
<llrp:AntennaIDs>0</llrp:AntennaIDs>
<llrp:AISpecStopTrigger>
<llrp:AISpecStopTriggerType>Null</llrp:AISpecStopTriggerType>
<llrp:DurationTrigger>0</llrp:DurationTrigger>
</llrp:AISpecStopTrigger>
<llrp:InventoryParameterSpec>
<llrp:InventoryParameterSpecID>40</llrp:InventoryParameterSpecID>
<llrp:ProtocolID>EPCGlobalClass1Gen2</llrp:ProtocolID>
<llrp:AntennaConfiguration>
<llrp:AntennaID>0</llrp:AntennaID>
<llrp:C1G2InventoryCommand>
<llrp:TagInventoryStateAware>1</llrp:TagInventoryStateAware>
<llrp:C1G2SingulationControl>
<llrp:Session>0</llrp:Session>
<llrp:TagPopulation>100</llrp:TagPopulation>
<llrp:TagTransitTime>0</llrp:TagTransitTime>
</llrp:C1G2SingulationControl>
</llrp:C1G2InventoryCommand>
</llrp:AntennaConfiguration>
</llrp:InventoryParameterSpec>
</llrp:AISpec>
<llrp:ROReportSpec>
<llrp:ROReportTrigger>Upon_N_Tags_Or_End_Of_ROSpec</llrp:ROReportTrigger>
<llrp:N>1</llrp:N>
<llrp:TagReportContentSelector>
<llrp:EnableROSpecID>1</llrp:EnableROSpecID>
<llrp:EnableSpecIndex>1</llrp:EnableSpecIndex>
<llrp:EnableInventoryParameterSpecID>1</llrp:EnableInventoryParameterSpecID>
<llrp:EnableAntennaID>1</llrp:EnableAntennaID>
<llrp:EnableChannelIndex>1</llrp:EnableChannelIndex>
<llrp:EnablePeakRSSI>1</llrp:EnablePeakRSSI>
<llrp:EnableFirstSeenTimestamp>1</llrp:EnableFirstSeenTimestamp>
<llrp:EnableLastSeenTimestamp>1</llrp:EnableLastSeenTimestamp>
<llrp:EnableTagSeenCount>1</llrp:EnableTagSeenCount>
<llrp:EnableAccessSpecID>1</llrp:EnableAccessSpecID>
<llrp:C1G2EPCMemorySelector>
<llrp:EnableCRC>1</llrp:EnableCRC>
<llrp:EnablePCBits>1</llrp:EnablePCBits>
</llrp:C1G2EPCMemorySelector>
</llrp:TagReportContentSelector>
</llrp:ROReportSpec>
</llrp:ROSpec>
</llrp:GET_ROSPECS_RESPONSE>
LLRP Tag Encoding
Here are the list of LLRP Tag Encoding Command Options LLRP_Tag_Encoding