GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> CTDB / V5-5-5 > ctdb_rt_test_sim / rad750


Interface   Data Structures   File List   Data Fields   Globals  

ctdb_rt_test_common.c File Reference

Function definitions for 1553 RT test application common to all implementations. More...

#include <stdio.h>
#include <stdlib.h>
#include <CTDB/CTDB_rt.h>
#include <CTDB/CO1553_util.h>
#include <CCSDS/CCSDS_pkt.h>
#include <CCSDS/CCSDS_dump.h>
#include <CCSDS/CCSDS_swap.h>
#include <PBS/PBS.h>
#include <PBS/TASK.h>
#include <PBS/TOC.h>
#include <PBS/TOV.h>
#include <PBS/MBA.h>
#include <MSG/MSG_pubdefs.h>
#include <MSG/MSG_printProc.h>
#include <CLI/CLI_pubdefs.h>
#include <ctdb_rt_test_private.h>

Defines

#define RT_CMD_RECV_PRI   150
#define RT_CMD_RECV_NAME   "uCmdRx"
#define MSG_PRI   210
#define RT_APID_TELEM   0x260
#define RT_APID_CMD_TX   0x600
#define RT_FUNC_CMD_TX   0

Functions

static void rt_pkt_free (void *pkt, void *arg)
static void rt_pkt_cmd_rx (void)
int rt_init (void *addr)
int rt_start (void)
int rt_stop (void)
int rt_exit (void)
int rt_diag (void)
int rt_clear (void)
int rt_pkt_telem (unsigned int size, int priority)
int rt_pkt_cmd_tx (unsigned int size)
static unsigned int rt_pkt_telem_parse (CLI_Control *cli, rt_test_config *config)
static unsigned int rt_pkt_cmd_tx_parse (CLI_Control *cli, rt_test_config *config)
static unsigned int rt_start_parse (CLI_Control *cli, rt_test_config *config)
static unsigned int rt_stop_parse (CLI_Control *cli, rt_test_config *config)
static unsigned int exit_parse (CLI_Control *cli, rt_test_config *config)
int main (int argc, char **argv)

Variables

rt_test_config rtTestConfig
static const char * dumpLine
static const char * initMsg = "RT not initialized\n"


Detailed Description

Function definitions for 1553 RT test application common to all implementations.

Author:
D.L. Wood

Define Documentation

#define MSG_PRI   210

The priority of the MSG output task.

Referenced by rt_init().

#define RT_APID_CMD_TX   0x600

A fake CCSDS application ID to use for sent telecommand packets.

Referenced by rt_pkt_cmd_tx().

#define RT_APID_TELEM   0x260

A fake CCSDS application ID to use for sent telemetry packets.

Referenced by rt_pkt_telem().

#define RT_CMD_RECV_NAME   "uCmdRx"

The name of the telecommand receive task (VxWorks only).

Referenced by rt_start().

#define RT_CMD_RECV_PRI   150

The priority to run the telecommand receive task (VxWorks only).

Referenced by rt_start().

#define RT_FUNC_CMD_TX   0

A fake function code to use for sent telecommand packets.

Referenced by rt_pkt_cmd_tx().


Function Documentation

unsigned int exit_parse ( CLI_Control *  cli,
rt_test_config config 
) [static]

CLI callback for "exit" command.

Parameters:
cli CLI control handle.
config Application configuration.
Returns:
CLI_ENDOFCMD

Referenced by main().

int main ( int  argc,
char **  argv 
)

UNIX entry point for test application.

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

References exit_parse(), rt_exit(), rt_init(), rt_pkt_cmd_tx_parse(), rt_pkt_telem_parse(), rt_start_parse(), and rt_stop_parse().

int rt_clear ( void   ) 

Resets remote terminal diagnostics.

Return values:
0 Success.
-1 Failure.

References CTDB_rtDiagClear(), _rt_test_config::initialized, initMsg, and _rt_test_config::rt.

int rt_diag ( void   ) 

int rt_exit ( void   ) 

Stops the test application and releases resources.

Return values:
0 Success.
-1 Failure.

References _rt_test_config::cmdRecvExit, _rt_test_config::cmdRecvTask, CTDB_rtExit(), _rt_test_config::initialized, initMsg, _rt_test_config::rt, and _rt_test_config::spawned.

Referenced by main().

int rt_init ( void *  addr  ) 

Initializes the test application. The device specific initialization is handled in rt_init_dev().

Parameters:
addr The remote terminal address (1553 RT or IP).
Return values:
0 Success.
-1 Failure.

References _rt_test_config::cmdRecvTask, _rt_test_config::cmdTxSeq, _rt_test_config::cmdTxVal, CTDB_rtGet(), _rt_test_config::hkpSeq, _rt_test_config::initialized, MSG_PRI, _rt_test_config::rt, rt_init_dev(), _rt_test_config::spawned, _rt_test_config::telemSeq, and _rt_test_config::telemVal.

Referenced by main().

static void rt_pkt_cmd_rx ( void   )  [static]

Listens for and displays telecommand receive packets arriving at the remote terminal.

References _rt_test_config::cmdRecvExit, CO1553_MSG_SIZE, CTDB_rtPktCmdRxFree(), CTDB_rtPktCmdRxRecv(), dumpLine, and _rt_test_config::rt.

Referenced by rt_start().

int rt_pkt_cmd_tx ( unsigned int  size  ) 

Sends a test telecommand transmit packet from the remote terminal.

Parameters:
size The size in bytes of faked test pattern data in packet.
Return values:
0 Success.
-1 Failure.

References _rt_test_config::cmdTxSeq, _rt_test_config::cmdTxVal, CO1553_MSG_SIZE, CTDB_rtPktCmdTxSend(), _rt_test_config::initialized, initMsg, _rt_test_config::rt, RT_APID_CMD_TX, RT_FUNC_CMD_TX, and rt_pkt_free().

Referenced by rt_pkt_cmd_tx_parse().

unsigned int rt_pkt_cmd_tx_parse ( CLI_Control *  cli,
rt_test_config config 
) [static]

CLI callback for "rt_pkt_cmd_tx" command.

Parameters:
cli CLI control handle.
config Application configuration.
Returns:
CLI_SUCCESS

References rt_pkt_cmd_tx().

Referenced by main().

static void rt_pkt_free ( void *  pkt,
void *  arg 
) [static]

Packet release callback used by test application.

Parameters:
pkt A pointer to the packet buffer.
arg User defined argument.

Referenced by rt_pkt_cmd_tx(), and rt_pkt_telem().

int rt_pkt_telem ( unsigned int  size,
int  priority 
)

Sends a test telemetry packet from the remote terminal.

Parameters:
size The size in bytes of faked test pattern data in packet.
priority The packet send priority: CTDB_RT_PRIORITY_HIGH or CTDB_RT_PRIORITY_LOW.
Return values:
0 Success.
-1 Failure.

References CO1553_MSG_SIZE, CTDB_rtPktTelemSend(), _rt_test_config::initialized, initMsg, _rt_test_config::rt, RT_APID_TELEM, rt_pkt_free(), _rt_test_config::telemSeq, and _rt_test_config::telemVal.

Referenced by rt_pkt_telem_parse().

unsigned int rt_pkt_telem_parse ( CLI_Control *  cli,
rt_test_config config 
) [static]

CLI callback for "rt_pkt_telem" command.

Parameters:
cli CLI control handle.
config Application configuration.
Returns:
CLI_SUCCESS

References CTDB_RT_PRIORITY_LOW, and rt_pkt_telem().

Referenced by main().

int rt_start ( void   ) 

Starts the remote terminal and packet receive tasks.

Return values:
0 Success.
-1 Failure.

References _rt_test_config::cmdRecvExit, _rt_test_config::cmdRecvTask, CTDB_rtStart(), _rt_test_config::initialized, initMsg, _rt_test_config::rt, RT_CMD_RECV_NAME, RT_CMD_RECV_PRI, rt_pkt_cmd_rx(), and _rt_test_config::spawned.

Referenced by rt_start_parse().

unsigned int rt_start_parse ( CLI_Control *  cli,
rt_test_config config 
) [static]

CLI callback for "rt_start" command.

Parameters:
cli CLI control handle.
config Application configuration.
Returns:
CLI_SUCCESS

References rt_start().

Referenced by main().

int rt_stop ( void   ) 

Stops the remote terminal and packet receive tasks.

Return values:
0 Success.
-1 Failure.

References _rt_test_config::cmdRecvExit, _rt_test_config::cmdRecvTask, CTDB_rtStop(), _rt_test_config::initialized, initMsg, _rt_test_config::rt, and _rt_test_config::spawned.

Referenced by rt_stop_parse().

unsigned int rt_stop_parse ( CLI_Control *  cli,
rt_test_config config 
) [static]

CLI callback for "rt_stop" command.

Parameters:
cli CLI control handle.
config Application configuration.
Returns:
CLI_SUCCESS

References rt_stop().

Referenced by main().


Variable Documentation

dumpLine [static]

Initial value:

 
                "-------------------------------------------------------------------------------\n"
A separator line for displays.

Referenced by rt_pkt_cmd_rx().

initMsg = "RT not initialized\n" [static]

An error message.

Referenced by rt_clear(), rt_diag(), rt_exit(), rt_pkt_cmd_tx(), rt_pkt_telem(), rt_start(), and rt_stop().

The global instance of the test application descriptor.


Generated on Tue Sep 27 14:39:23 2011 by  doxygen 1.5.8