Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

dx101.cpp File Reference

Stand alone test of LTKC frame decoder and encoder, and XML encoder. More...

#include <stdio.h>
#include "ltkcpp.h"

Go to the source code of this file.

Functions

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


Detailed Description

Stand alone test of LTKC frame decoder and encoder, and XML encoder.

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

DX101 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

dx101 ../../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 dx101.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 421 of file dx101.cpp.

Referenced by main().

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 89 of file dx101.cpp.

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


Generated on Wed Nov 26 12:27:45 2008 for LTKCPP-- LLRP Toolkit C Plus Plus Library by  doxygen 1.3.9.1