GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> CCSDS / dev > ccsds_pkt_test / rhel4-32


Interface   Data Structures   File List   Data Fields   Globals  

ccsds_pkt_test.c File Reference

Function definitions for CCSDS packet format test program. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <CCSDS/CCSDS_pkt.h>
#include <CCSDS/CCSDS_dump.h>
#include <CCSDS/ccsds_pkt_test.h>
#include <CLI/CLI_pubdefs.h>
#include <MSG/MSG_pubdefs.h>
#include <MSG/MSG_printProc.h>
#include <PBS/TASK.h>

Classes

struct  _Pkt_Test_Config

Typedefs

typedef enum _Pkt_Test_State Pkt_Test_State
typedef struct _Pkt_Test_Config Pkt_Test_Config

Enumerations

enum  _Pkt_Test_State {
  PKT_TEST_STATE_EMPTY,
  PKT_TEST_STATE_CREATED
}

Functions

static unsigned int pt_create (CLI_Control *control, Pkt_Test_Config *config)
static unsigned int pt_set (CLI_Control *control, Pkt_Test_Config *config)
static unsigned int pt_get (CLI_Control *control, Pkt_Test_Config *config)
static unsigned int pt_dump (CLI_Control *control, Pkt_Test_Config *config)
static unsigned int pt_help (CLI_Control *control, Pkt_Test_Config *config)
static unsigned int pt_exit (CLI_Control *control, Pkt_Test_Config *config)
static void pt_print (Pkt_Test_Config *config)
int main (int argc, char **argv)

Variables

static Pkt_Test_Config ptconfig


Detailed Description

Function definitions for CCSDS packet format test program.

Author:
D.L. Wood

Typedef Documentation

The typedef for _Pkt_Test_Config.

The typedef for _Pkt_Test_State.


Enumeration Type Documentation

Defines the state of the test application.

Enumerator:
PKT_TEST_STATE_EMPTY  A test packet has not yet been created.
PKT_TEST_STATE_CREATED  A test packet has been created.


Function Documentation

int main ( int  argc,
char **  argv 
)

The application entry point.

Parameters:
argc The number of command line args.
argv The list of command line args.
Return values:
0 Success.
-1 Failure.

References PKT_TEST_STATE_EMPTY, pt_create(), pt_dump(), pt_exit(), pt_get(), pt_help(), pt_set(), and _Pkt_Test_Config::state.

static unsigned int pt_create ( CLI_Control *  control,
Pkt_Test_Config config 
) [static]

Creates a new packet in response to the "create" command.

Parameters:
control The CLI control structure.
config A pointer to the application configuration info.
Return values:
CLI_SUCCESS Success.
CLI_BADSNTX The command did not have proper syntax.

References CCSDS_PKT_SEQ_FIRST, CCSDS_PKT_SEQ_LAST, CCSDS_PKT_SEQ_MID, CCSDS_PKT_SEQ_NONE, CCSDS_PKT_TYPE_CMD, CCSDS_PKT_TYPE_TELEM, CCSDS_pktHdrCreate(), CCSDS_pktHdrSizeof(), _Pkt_Test_Config::pkt, PKT_TEST_STATE_CREATED, PKT_TEST_STATE_EMPTY, pt_print(), _Pkt_Test_Config::state, and _Pkt_Test_Config::type.

Referenced by main().

static unsigned int pt_dump ( CLI_Control *  control,
Pkt_Test_Config config 
) [static]

Displays the contents of the entiere packet header.

Parameters:
control The CLI control structure.
config A pointer to the application configuration info.
Return values:
CLI_SUCCESS Success.
CLI_BADSNTX The command did not have proper syntax or the test packet has not been created.

References CCSDS_dumpPktHdr(), _Pkt_Test_Config::pkt, PKT_TEST_STATE_CREATED, and _Pkt_Test_Config::state.

Referenced by main().

static unsigned int pt_exit ( CLI_Control *  control,
Pkt_Test_Config config 
) [static]

Quits the application in reponse to the "exit" command.

Parameters:
control The CLI control structure.
config A pointer to the application configuration info.
Returns:
CLI_ENDOFCMD to stop the CLI interpreter.

References _Pkt_Test_Config::pkt, PKT_TEST_STATE_CREATED, and _Pkt_Test_Config::state.

Referenced by main().

static unsigned int pt_get ( CLI_Control *  control,
Pkt_Test_Config config 
) [static]

Retrieves a value from the test packet in response to the "get" command.

Parameters:
control The CLI control structure.
config A pointer to the application configuration info.
Return values:
CLI_SUCCESS Success.
CLI_BADSNTX The command did not have proper syntax or the test packet has not been created.

References CCSDS_PKT_SEQ_FIRST, CCSDS_PKT_SEQ_LAST, CCSDS_PKT_SEQ_MID, CCSDS_PKT_SEQ_NONE, CCSDS_PKT_TYPE_CMD, CCSDS_PKT_TYPE_TELEM, CCSDS_pktHdrGetApid(), CCSDS_pktHdrGetFuncCode(), CCSDS_pktHdrGetLength(), CCSDS_pktHdrGetSeqCount(), CCSDS_pktHdrGetSeqFlags(), CCSDS_pktHdrGetTime(), CCSDS_pktHdrGetType(), _Pkt_Test_Config::pkt, PKT_TEST_STATE_CREATED, and _Pkt_Test_Config::state.

Referenced by main().

unsigned int pt_help ( CLI_Control *  control,
Pkt_Test_Config config 
) [static]

Prints a summary of the command syntax in response to the "help" command.

Parameters:
control The CLI control structure.
config A pointer to the application configuration info.
Returns:
CLI_SUCCESS

Referenced by main().

static void pt_print ( Pkt_Test_Config config  )  [static]

Displays the hex dump of the test packet contents.

Parameters:
config A pointer to the application configuration info.

References CCSDS_pktHdrSizeof(), _Pkt_Test_Config::pkt, and _Pkt_Test_Config::type.

Referenced by pt_create(), and pt_set().

static unsigned int pt_set ( CLI_Control *  control,
Pkt_Test_Config config 
) [static]

Sets a value in the test packet in response to the "set" command.

Parameters:
control The CLI control structure.
config A pointer to the application configuration info.
Return values:
CLI_SUCCESS Success.
CLI_BADSNTX The command did not have proper syntax or the test packet has not been created.

References CCSDS_PKT_SEQ_FIRST, CCSDS_PKT_SEQ_LAST, CCSDS_PKT_SEQ_MID, CCSDS_PKT_SEQ_NONE, CCSDS_pktHdrSetApid(), CCSDS_pktHdrSetFuncCode(), CCSDS_pktHdrSetLength(), CCSDS_pktHdrSetSeqCount(), CCSDS_pktHdrSetSeqFlags(), CCSDS_pktHdrSetTime(), _Pkt_Test_Config::pkt, PKT_TEST_STATE_CREATED, pt_print(), and _Pkt_Test_Config::state.

Referenced by main().


Variable Documentation

ptconfig [static]

The test application global configuration info.


Generated on Thu Mar 24 19:26:35 2011 by  doxygen 1.5.8