llrp2xml.cpp File Reference

Converts an LLRP binary stream to an LTK-XML packet sequence. More...

#include <stdio.h>
#include "ltkcpp.h"
#include "Impinj/impinj_ltkcpp.h"
#include "Impinj/impinjinternal_ltkcpp.h"

Go to the source code of this file.

Defines

#define FRAME_BUF_SIZE   (4u*1024u*1024u)
#define XML_TEXT_BUF_SIZE   (10u * FRAME_BUF_SIZE)

Functions

void dump (unsigned char *pBuffer, unsigned int nBuffer)
 Print a buffer in hex.
int main (int ac, char *av[])
 Command main routine.

Variables

unsigned char aInBuffer [FRAME_BUF_SIZE]
char aXMLTextBuf [XML_TEXT_BUF_SIZE]


Detailed Description

Converts an LLRP binary stream to an LTK-XML packet sequence.

This is diagnostic 101 for the LLRP Tool Kit for C++ (LTKCPP).

llrp2xml reads an input file that contains consecutive LLRP frames, sometimes called the "binary encoding". Its output is printed on stdout.

For each input frame:

This program can be tested using tools like valgrind (please see http://en.wikipedia.org/wiki/Valgrind) that detect memory leaks.

There are "golden" test files under the ../../Tests/dx101/ directory. Normal use is something like

llrp2xml ../../Tests/dx101/dx101_in.bin > dx101_out.tmp

Then to verify proper function, the output file is compared

cmp ../../Tests/dx101/dx101_out.txt dx101_out.tmp

When the files compare it means the dx101 and the LTKC are correct.

Definition in file llrp2xml.cpp.


Function Documentation

void dump ( unsigned char *  pBuffer,
unsigned int  nBuffer 
)

Print a buffer in hex.

And don't we always need one of these.

  • 16 bytes per line
  • extra space every four bytes
  • full lines have a three digit sum, used to speed visually comparing entire lines.

Parameters:
[in] pBuffer Pointer to buffer
[in] nBuffer Number of valid bytes in buffer
Returns:
none

Definition at line 389 of file llrp2xml.cpp.

int main ( int  ac,
char *  av[] 
)

Command main routine.

Command synopsis:

dx101 INPUTFILE

0 Everything *seemed* to work. 1 Bad usage 2 Could not open input file

Definition at line 131 of file llrp2xml.cpp.

References LLRP::enrollImpinjTypesIntoRegistry(), LLRP::CErrorDetails::m_eResultCode, LLRP::CFieldDescriptor::m_pName, LLRP::CTypeDescriptor::m_pName, LLRP::CErrorDetails::m_pRefField, and LLRP::CErrorDetails::m_pRefType.


Generated on Wed Jun 6 11:55:49 2012 for LTKCPP-- LLRP Toolkit C Plus Plus Library by  doxygen 1.5.9