Specifications

System Software Diagnostics Guide — September 2006 95
GCEV_TRACEDATA Reference
// TraceData->seq_no (unsigned long)
// TraceData->data_size (unsigned short)
// TraceData->data_buf (char[data_size])
//
// Ideally allow selective output on a per timeslot basis
//
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <conio.h>
#include <string.h>
#define CAS_DATA 0x02
#define R2MF_TONE 0x04
#define SIGDET_ON 0x08
#define SIGDET_OFF 0x10
FILE *hInFile;
FILE *hOutFile;
// Function Prototypes
void mdfProcessCas(void);
void mdfProcessR2mf(void);
void mdfProcessToneOn(void);
void mdfProcessToneOff(void);
void mdfProcessTimestamp(void);
char* mdfLsNibble2Bin(unsigned char Code);
char* mdfMsNibble2Bin(unsigned char Code);
char* mdfByte2Bin(unsigned char Code);
void mdfReadError(char* szMsg);
void main(int argc, char *argv[])
{
unsigned long iSeq;
unsigned long iSeqCheck = 1;
unsigned short iSize;
unsigned char iType;
fpos_t iPos;
fpos_t iPayloadEnd;
// Test Source File is Specified
if(argc < 2)
{
printf("Input File Not Specified\n");
printf("Usage: %s InputFile\n", argv[0]);
return;
}
// Open Source File
if((hInFile = fopen(argv[1], "rb")) == NULL)
{
printf("File Open Failed On %s\n", argv[1]);
return;
}
// add a .txt to the input filename
strcat(argv[1], ".parsed.txt");
// create output file
if((hOutFile = fopen(argv[1], "w")) == NULL)
{
printf("File Open Failed On %s\n", argv[1]);