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


Interface   Data Structures   File List   Data Fields   Globals  

ctdb_com_test_poll.c File Reference

Function definitions for 1553 RT link test application for polled mode drivers. More...

#include <vxWorks.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <CTDB/SUMT_rt_poll.h>
#include <CTDB/CO1553_util.h>
#include <CTDB/CO1553_rt.h>
#include <CTDB/CTDB_config.h>
#include <CCSDS/CCSDS_pkt.h>
#include <PBS/PBS.h>
#include <PBS/MBA.h>
#include <PBS/TASK.h>
#include <MSG/MSG_pubdefs.h>
#include <MSG/MSG_printProc.h>
#include <ctdb_com_test_private.h>

Classes

struct  _test_config

Defines

#define RT_POLL_NAME   "uRTPoll"
#define RT_POLL_PRI   250
#define MSG_PRI   210
#define WDOG_RESET

Typedefs

typedef struct _test_config test_config

Functions

static void rt_poll (void)
static void rt_pkt_hkp (void)
static void rt_pkt_cmd_rx (unsigned char *cmdPkt)
static void rt_pkt_diag (unsigned char *cmdPkt)
static void rt_pkt_sc (unsigned char *cmdPkt)
static void rt_pkt_fill (unsigned char *pkt, unsigned short patSelect, unsigned short patLength, unsigned short respLength)
int rt_init (unsigned short rtAddr)
int rt_exit (void)
int rt_start (void)
int rt_stop (void)

Variables

static SUMT_RT_Bus_Config busConfig
static test_config Config


Detailed Description

Function definitions for 1553 RT link test application for polled mode drivers.

Author:
D.L. Wood

Define Documentation

#define MSG_PRI   210

The priority of the MSG output task.

Referenced by rt_init().

#define RT_POLL_NAME   "uRTPoll"

The name of the RT polling task.

Referenced by rt_start().

#define RT_POLL_PRI   250

The priority of the RT polling task.

Referenced by rt_start().

#define WDOG_RESET

Resets the watchdog timer on the RAD750; a no-op for other targets.

Referenced by rt_poll().


Typedef Documentation

The typedef for _test_config.


Function Documentation

int rt_exit ( void   ) 

Stops the test application and releases resources.

Return values:
0 Success.
-1 Failure.

References _test_config::task, _test_config::telem_buf, and _test_config::telem_pkt.

int rt_init ( unsigned short  addr  ) 

Initializes the test application. The driver is initialized and a the RT polling task is started.

Parameters:
addr The remote terminal address.
Return values:
0 Success.
-1 Failure.

References _test_config::cmd_hdr_size, CO1553_MSG_SIZE, _test_config::exit, _test_config::hkp_param, MSG_PRI, _test_config::rt, _test_config::seq_hkp, SUMT_rtPollGet(), SUMT_rtPollInit(), _test_config::task, _test_config::telem_buf, _SUMT_RT_Bus_Config::telem_msg_count, _test_config::telem_pkt, _test_config::time_sec, TLM_COM_TEST_HKP_SIZE, TLM_COM_TEST_ITEM_SIZE, and _test_config::tlm_hdr_size.

static void rt_pkt_cmd_rx ( unsigned char *  cmdPkt  )  [static]

Listens for telecommand receive packets arriving at the remote terminal. The SC broadcast telecommands (APID=0x701) are discarded. The communications test diagnostic telecommands (APID=0x646) are parsed and the appropriate telemetry response actions taken. The rececption of any other telecommands is considered an error condition.

Parameters:
cmdPkt A pointer to the telecommand packet buffer.

References APID_TC_LAT_DIAG, APID_TC_SC_BROADCAST, _test_config::cmd_hdr_size, rt_pkt_diag(), and rt_pkt_sc().

Referenced by rt_poll().

static void rt_pkt_diag ( unsigned char *  cmdPkt  )  [static]

static void rt_pkt_fill ( unsigned char *  pkt,
unsigned short  patSelect,
unsigned short  patLength,
unsigned short  respLength 
) [static]

Fills in the response data for a communication test telemetry packet.

Parameters:
pkt A pointer to the telmetry packet buffer.
patSelect The pattern select code.
patLength The pattern length value.
respLength The response length value.

References _test_config::pat_data, and TLM_COM_TEST_ITEM_SIZE.

Referenced by rt_pkt_hkp().

static void rt_pkt_hkp ( void   )  [static]

static void rt_pkt_sc ( unsigned char *  cmdPkt  )  [static]

Handles diagnostics SC broadcase telecommands.

Parameters:
cmdPkt A pointer to the telecommand packet buffer.

References _test_config::cmd_hdr_size, FUNC_CODE_SC_SIANCILLARY, FUNC_CODE_SC_SIATTITUDE, FUNC_CODE_SC_SITIMETONE, _TC_SIANCILLARY_Param::sclk_seconds, and _test_config::time_sec.

Referenced by rt_pkt_cmd_rx().

static void rt_poll ( void   )  [static]

Test application polling task. Constantly polls the RT for new events. For this test telemetry events are ignored and all telecommand input is discarded.

Return values:
0 Success.
-1 Failure.

References CO1553_MSG_SIZE, _test_config::exit, _test_config::rt, rt_pkt_cmd_rx(), rt_pkt_hkp(), SUMT_RT_SUBADDR_CMD_RX, SUMT_RT_SUBADDR_TELEM_END, SUMT_rtPollQuery(), and WDOG_RESET.

Referenced by rt_start().

int rt_start ( void   ) 

Starts the remote terminal.

Return values:
0 Success.
-1 Failure.

References _test_config::rt, rt_poll(), RT_POLL_NAME, RT_POLL_PRI, SUMT_rtPollStart(), and _test_config::task.

int rt_stop ( void   ) 

Stops the remote terminal.

Return values:
0 Success.
-1 Failure.

References _test_config::exit, and _test_config::task.


Variable Documentation

busConfig [static]

The RT driver 1553 bus configuration.

Config [static]

The test configuration structure.


Generated on Wed Nov 21 20:06:45 2012 by  doxygen 1.5.8