This package consists of routines to encode LLRP-XML documents into LLRP Binary Format, and to decode LLRP-XML documents from LLRP Binary format.
LLRP messages and parameters are naturally modelled as XML. This package provides routines to compile LLRP-XML documents into LLRP Binary Format which can then be transmitted to an LLRP Reader.
use RFID::LLRP::Builder qw(encode_message decode_message);
use RFID::LLRP::Link qw(reader_connect reader_disconnect read_message);
my $doc = <<'EOT';
<?xml version="1.0" encoding="UTF-8"?>
<GET_READER_CAPABILITIES MessageID="0">
<RequestedData>0</RequestedData>
</GET_READER_CAPABILITIES>
EOT
my $sock = reader_connect ('speedway-xx-yy-zz');
$sock->send (encode_message ($doc));
print (decode_message read_message ($sock))->toString (1);
reader_disconnect ($sock);
encode_message ($document, %options)This function will take an XML document and encode it as a LLRP Binary formatted message.
$document can be a string, a file name, or a XML::LibXML document.
To supply a string, call encode_message ($str).
To supply a file, call encode_message ($fname, File => 1).
To supply an XML::LibXML document, call encode_message ($xmldoc, Tree => 1).
This routine returns the LLRP Binary formatted message as a string. In most cases, this string will be written to a socket associated with a reader that understands LLRP.
decode_message ($str)This function accepts an LLRP Binary formatted message decodes it, and returns an analogous LLRP/XML formatted message.
Once in XML format, the LLRP message can be subjected to further analysis or modification using the full power of XML::LibXML and XPath, validated against the LLRP W3C XML Schema (LLRP.xsd), or serialized to a text file for version control or archival purposes.
QualifyCore
This routine accepts the QualifyCore parameter. Its use and purpose is described
in the POD for RFID::LLRP::Link transact.
John R. Hogerhuis
Chris Delaney
None
EPCGlobal LLRP Specification
Licensed under the Apache License, Version 2.0 (the ``License''); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an ``AS IS'' BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.