GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LCBT / dev > ssrsim / rad750
#include <LCBT/TDATA.h>
#include <LCBT/LCBT_initBoard.h>
#include <LCBT_printf.h>
#include <PBS/WCT.h>
#include <CCSDS/CCSDS_pkt.h>
Functions | |
void | TDATA_create (unsigned short *ptr, int lenIn16b, int ccsds, TDATA_DTEST testType, unsigned int testParm) |
Create a self describing test data buffer. | |
void | TDATA_setCcsdsParms (unsigned int appId) |
set prameters for all CCSDS packets | |
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. | |
unsigned int | TDATA_getRandCtxForSeqVal (unsigned int seed) |
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 |
14 bytes - optional CCSDS header, default AppId=0x3bf 8 bytes header defined as follows unsigned short lenIn16b - length of this heeader plus data buffer to follow (does not include length of the optional CCSDS packet or 32b synch workd before CCSDS) unsigned short where top unsigned byte checksum - checksum of header bottom unsigned byte testType - type of test data packet (see below)
unsigned short testParm - parameter related to test data packet type unsigned short taskId - id of producing task (to differentiate between different senders) 2*lenIn16b bytes of data buffer
The testType and use of testParm is as follows:
testType = TDATA_DTEST_CONSTANT = 1 testParm = 16b constant value to be repeated as data
testType = TDATA_DTEST_INCREMENT = 0 testParm = 16b start value that is incremented on each 16b word
testType = TDATA_DTEST_RANDOM = 2 testParm = seed value for random generator, values are 16b but appear random in all dTypes
testType = TDATA_DTEST_WALK1 = 3 testParm = 8=walk on bytes, 16=walk on 16b words, 32=walk on 32b words
testType = TDATA_DTEST_TRANS01 = 4 testParm = number of bits of 0's before all 1's in each packet
testType = TDATA_DTEST_TRANS10 = 5 testParm = number of bits of 1's before all 0's in each packet
testType = DTEST_TASKID = 6 testParm = (not used)
The data buffer is assumed to be an array of short (16 bit) data words
int TDATA_compare | ( | unsigned short * | ptr, | |
int | lenIn16b, | |||
int | ccsds, | |||
int | printErrs | |||
) |
Analyse a self describing test data buffer for errors.
ptr | ||
lenIn16b | ||
ccsds | 1=expect CCSDS header on data | |
printErrs | 1=print errors as found |
References TDATA_compareSeq().
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.
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 |
References EPRINTF, TDATA_DTEST_CONSTANT, TDATA_DTEST_INCREMENT, TDATA_DTEST_RANDOM, TDATA_DTEST_TASKID, TDATA_DTEST_TRANS01, TDATA_DTEST_TRANS10, and TDATA_DTEST_WALK1.
Referenced by TDATA_compare().
void TDATA_create | ( | unsigned short * | ptr, | |
int | lenIn16b, | |||
int | ccsds, | |||
TDATA_DTEST | testType, | |||
unsigned int | testParm | |||
) |
Create a self describing test data buffer.
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 |
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
References TDATA_DTEST_CONSTANT, TDATA_DTEST_INCREMENT, TDATA_DTEST_RANDOM, TDATA_DTEST_TASKID, TDATA_DTEST_TRANS01, TDATA_DTEST_TRANS10, and TDATA_DTEST_WALK1.
unsigned int TDATA_getNextSeqVal | ( | TDATA_DTEST | testType, | |
unsigned int | testParm, | |||
int | idx, | |||
unsigned int * | randCtx | |||
) |
Create a data sequence one word at a time.
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() |
References TDATA_DTEST_CONSTANT, TDATA_DTEST_INCREMENT, TDATA_DTEST_RANDOM, TDATA_DTEST_TASKID, TDATA_DTEST_TRANS01, TDATA_DTEST_TRANS10, and TDATA_DTEST_WALK1.
unsigned int TDATA_getRandCtxForSeqVal | ( | unsigned int | seed | ) |
Create contex to use with TDATA_getNextSeqVal().
seed | seed value for random number generator |
void TDATA_setCcsdsParms | ( | unsigned int | appId | ) |
set prameters for all CCSDS packets
appId | set the AppId fiels within CCSDS header |
Referenced by SSRSIM_init().
char* TDATA_testStr | ( | TDATA_DTEST | testType | ) |
convert test type enum to a string
testType | enum to turn to string |
References TDATA_DTEST_CONSTANT, TDATA_DTEST_INCREMENT, TDATA_DTEST_RANDOM, TDATA_DTEST_TASKID, TDATA_DTEST_TRANS01, TDATA_DTEST_TRANS10, and TDATA_DTEST_WALK1.