GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LCBT / V1-6-1

Constituent: test_tdata     Tag: linux-gcc


Interface   Data Structures   File List   Data Fields   Globals  

TDATA.h File Reference

Module to create and check a self-describing test data packet. More...

This graph shows which files directly or indirectly include this file:


Typedefs

typedef enum _TDATA_DTEST TDATA_DTEST
 Specifies data sequence for various test.

Enumerations

enum  _TDATA_DTEST {
  TDATA_DTEST_INCREMENT = 0,
  TDATA_DTEST_CONSTANT = 1,
  TDATA_DTEST_RANDOM = 2,
  TDATA_DTEST_WALK1 = 3,
  TDATA_DTEST_TRANS01 = 4,
  TDATA_DTEST_TRANS10 = 5,
  TDATA_DTEST_TASKID = 6
}

Functions

void TDATA_create (unsigned short *ptr, int lenIn16b, int ccsds, TDATA_DTEST testType, unsigned int testParm)
 Create a self describing test data buffer.
int TDATA_compare (unsigned short *ptr, int lenIn16b, int ccsds, int printErrs)
 Analyse a self describing test data buffer for errors.
int TDATA_compareSeq (unsigned short *ptr, int lenIn16b, int seq, int ccsds, int printErrs)
 Analyse a buffer segment of a self describing test data buffer for errors.
void TDATA_setCcsdsParms (unsigned int appId)
 set prameters for all CCSDS packets
unsigned int TDATA_getRandCtxForSeqVal (unsigned int testParm)
 Create contex to use with TDATA_getNextSeqVal().
unsigned int TDATA_getNextSeqVal (TDATA_DTEST testType, unsigned int testParm, int idx, unsigned int *randCtx)
 Create a data sequence one word at a time.
char * TDATA_testStr (TDATA_DTEST testType)
 convert test type enum to a string

Detailed Description

Module to create and check a self-describing test data packet.

Author:
Ed Bacho - ebacho@slac.stanford.edu

Enumeration Type Documentation

enum _TDATA_DTEST
 

Enumerator:
TDATA_DTEST_INCREMENT  The data increments for each data unit, testParm is start value
TDATA_DTEST_CONSTANT  The data is of constant value, testParm is value
TDATA_DTEST_RANDOM  The data changes value randomly, testParm is seed
TDATA_DTEST_WALK1  The data changes has walking 1's, testParm is number of 1's
TDATA_DTEST_TRANS01  The data changes from all 0's to all 1's, testParm is number of 0's before 1's
TDATA_DTEST_TRANS10  The data changes from all 1's to all 0's, testParm is number of 1's before 0's
TDATA_DTEST_TASKID  The data is the creating 32b taskId t


Function Documentation

int TDATA_compare unsigned short *  ptr,
int  lenIn16b,
int  ccsds,
int  printErrs
 

Analyse a self describing test data buffer for errors.

Parameters:
ptr 
lenIn16b 
ccsds 1=expect CCSDS header on data
printErrs 1=print errors as found
Returns:
number of errors detected
This checks a data buffer created with TDATA_create(). The buffer is assumd to be complete. Buffers broken into sequences should use TDATA_compareSeq.

WARNING: Because of the sequence handling, this routine is no longer thread safe. It assumes a single thread is calling it and that sequences of buffer segments are received in order.

int TDATA_compareSeq unsigned short *  ptr,
int  lenIn16b,
int  seq,
int  ccsds,
int  printErrs
 

Analyse a buffer segment of a self describing test data buffer for errors.

Parameters:
ptr The buffer segment to be compared
lenIn16b length of this seqment
seq sequence number of this buffer segment where seq=0 is the first
ccsds 1=expect CCSDS header on data
printErrs 1=print errors as found
Returns:
number of errors detected
This checks a data buffer created with TDATA_create(). However this routine will alloc one to check the buffer when it is broken into a number segments (as done by the EBM, Event Builder Module). The sequence number of the segment must be specified and seq=0 MUST be first. Info about the buffer is stored staticly on seq=0 and used when seq!=0.

WARNING: Because of the sequence handling, this routine is no longer thread safe. It assumes a single thread is calling it and that sequences of buffer segments are received in order.

void TDATA_create unsigned short *  ptr,
int  lenIn16b,
int  ccsds,
TDATA_DTEST  testType,
unsigned int  testParm
 

Create a self describing test data buffer.

Parameters:
ptr 
lenIn16b - total length of buffer including 8 byte header, data, and optional 14 byte CCSDS
ccsds 1=put CCSDS header on data sent out as event
testType Specifies the data sequence for test
testParm Parm to use with testType
Returns:
none
This creates a data buffer with an 8 byte header that describes the data so that TDATA_compare() can compare and determine if the data has been corrupted.

The testType and use of testParm is as follows:

testType = TDATA_DTEST_CONSTANT testParm = 16b constant value to be repeated as data

testType = TDATA_DTEST_INCREMENT testParm = 16b start value that is incremented on each 16b word

testType = TDATA_DTEST_RANDOM testParm = seed value for ranom generator, values are 16b but appear random in all dTypes

testType = TDATA_DTEST_WALK1 testParm = 8=walk on bytes, 16=walk on 16b words, 32=walk on 32b words

testType = TDATA_DTEST_TRANS01 testParm = number of bits of 0's before all 1's in each packet

testType = TDATA_DTEST_TRANS10 testParm = number of bits of 1's before all 0's in each packet

TDATA_getNextSeqVal TDATA_DTEST  testType,
unsigned int  testParm,
int  idx,
unsigned int *  randCtx
 

Create a data sequence one word at a time.

Parameters:
testType type of data sequence
testParm parm for data sequence
idx index into sequence
randCtx if testType==TDATA_DTEST_RANDOM, supply pointer to int returned from TDATA_getRandCtxForSeqVal()
Returns:
data value in sequence
Create a data sequence one word at a time. TDATA_initSeq() needs to be called first.

TDATA_getRandCtxForSeqVal unsigned int  seed  ) 
 

Create contex to use with TDATA_getNextSeqVal().

Parameters:
seed seed value for random number generator
Returns:
contex to be used for random number generator

void TDATA_setCcsdsParms unsigned int  appId  ) 
 

set prameters for all CCSDS packets

Parameters:
appId set the AppId fiels within CCSDS header
Returns:
none

const char * TDATA_testStr TDATA_DTEST  testType  ) 
 

convert test type enum to a string

Parameters:
testType enum to turn to string
Returns:
string of given enum


Generated on Sun Jun 14 01:44:13 2009 by  doxygen 1.4.4