GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> CTDB / V5-5-5 > ctdb_link_test_intr / rad750
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <CTDB/CTDB_rt.h>
#include <CTDB/SUMT_rt.h>
#include <CTDB/CTDB_config.h>
#include <CTDB/CTDB_tlmdefs.h>
#include <CCSDS/CCSDS_pkt.h>
#include <PBS/PBS.h>
#include <PBS/TASK.h>
#include <PBS/MBA.h>
#include <PBS/TOC.h>
#include <PBS/WCT.h>
#include <MSG/MSG_pubdefs.h>
#include <MSG/MSG_printProc.h>
Classes | |
struct | _test_config |
Defines | |
#define | RT_APID_HKP 0x20e |
#define | RT_SIZE_HKP 102 |
#define | SUMT_RT_TASK_NAME "uRT" |
#define | SUMT_RT_TASK_STACK 0x2000 |
#define | SUMT_RT_TASK_PRI 60 |
#define | RT_CMD_RECV_PRI 150 |
#define | RT_CMD_RECV_NAME "uCmdRx" |
#define | MSG_PRI 210 |
#define | WDOG_RESET |
Typedefs | |
typedef struct _test_config | test_config |
Functions | |
static unsigned int | rt_pkt_hkp (void *buf, void *arg) |
static unsigned int | rt_null_hkp (void *buf, void *arg) |
static void | rt_pkt_cmd_rx (void) |
int | rt_init (void) |
int | rt_start (void) |
int | rt_stop (void) |
int | rt_exit (void) |
int | rt_hkp (void) |
int | rt_diag (void) |
Variables | |
static SUMT_RT_Bus_Config | busConfig |
static const SUMT_RT_Pkt_Config | pktConfig |
static const SUMT_RT_Callback_Config | cbConfig |
static const SUMT_RT_Task_Config | taskConfig |
static test_config | Config |
#define MSG_PRI 210 |
The priority of the MSG output task.
Referenced by rt_init().
#define RT_APID_HKP 0x20e |
A fake CCSDS application ID to use for sent HKP telemetry packets.
Referenced by rt_pkt_hkp().
#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_SIZE_HKP 102 |
The size in bytes of the test HKP telemetry packets.
Referenced by rt_pkt_hkp().
#define SUMT_RT_TASK_NAME "uRT" |
The name of the remote terminal service task.
#define SUMT_RT_TASK_PRI 60 |
The priority of the remote terminal service task.
#define SUMT_RT_TASK_STACK 0x2000 |
The size in bytes of the remote terminal service task stack.
#define WDOG_RESET |
Resets the watchdog timer on the RAD750; a no-op for other targets.
Referenced by rt_pkt_cmd_rx().
The typedef for _test_config.
int rt_diag | ( | void | ) |
Displays remote terminal diagnostics.
0 | Success. | |
-1 | Failure. |
References _CTDB_RT_Diag::cmd_rx_byte_count, _CTDB_RT_Diag::cmd_rx_pkt_count, _CTDB_RT_Diag::cmd_tx_byte_count, _CTDB_RT_Diag::cmd_tx_pkt_count, CTDB_rtDiagGet(), _CTDB_RT_Diag::error_count, _CTDB_RT_Diag::hkp_byte_count, _CTDB_RT_Diag::hkp_pkt_count, _CTDB_RT_Diag::intr_count, _test_config::rt, _CTDB_RT_Diag::telem_byte_count, and _CTDB_RT_Diag::telem_pkt_count.
int rt_exit | ( | void | ) |
Stops the test application and releases resources.
0 | Success. | |
-1 | Failure. |
References CTDB_rtExit(), _test_config::rt, and _test_config::task.
int rt_hkp | ( | void | ) |
Changes the HKP callback from the null version to the diagnostics version.
0 | Success. | |
-1 | Failure. |
References CTDB_rtHkpSet(), _test_config::rt, and rt_pkt_hkp().
int rt_init | ( | void | ) |
Initializes the target side of the test application.
0 | Success. | |
-1 | Failure. |
References CTDB_rtGet(), _test_config::exit, MSG_PRI, _test_config::rt, SUMT_rtInit(), and _test_config::task.
static unsigned int rt_null_hkp | ( | void * | buf, | |
void * | arg | |||
) | [static] |
Driver callback for HKP telemetry packet generation. A no-op to allow testing of the HKP callback change operation in the driver.
buf | The buffer for holding the HKP packet. | |
arg | User defined argument. |
static void rt_pkt_cmd_rx | ( | void | ) | [static] |
Listens for and discards telecommand receive packets arriving at the remote terminal. Necessary to prevent telecommand receive queue overflow from SC broadcast messages while test is running.
References CTDB_rtPktCmdRxFree(), CTDB_rtPktCmdRxRecv(), _test_config::exit, _test_config::rt, and WDOG_RESET.
Referenced by rt_start().
static unsigned int rt_pkt_hkp | ( | void * | buf, | |
void * | arg | |||
) | [static] |
Driver callback for HKP telemetry packet generation. Generates APID 0x20e RT diagnostics telemetry. The head of the HKP packet is filled with the RT diagnostics counters values.
buf | The buffer for holding the HKP packet. | |
arg | User defined argument. |
References _CTDB_RT_Diag::cmd_rx_byte_count, _CTDB_LCTDBRTDIAG_Tlm::cmd_rx_byte_count, _CTDB_RT_Diag::cmd_rx_pkt_count, _CTDB_LCTDBRTDIAG_Tlm::cmd_rx_pkt_count, _CTDB_RT_Diag::cmd_tx_byte_count, _CTDB_LCTDBRTDIAG_Tlm::cmd_tx_byte_count, _CTDB_RT_Diag::cmd_tx_pkt_count, _CTDB_LCTDBRTDIAG_Tlm::cmd_tx_pkt_count, CTDB_rtDiagGet(), _CTDB_RT_Diag::error_count, _CTDB_LCTDBRTDIAG_Tlm::error_count, _CTDB_RT_Diag::hkp_byte_count, _CTDB_LCTDBRTDIAG_Tlm::hkp_byte_count, _CTDB_RT_Diag::hkp_pkt_count, _CTDB_LCTDBRTDIAG_Tlm::hkp_pkt_count, _CTDB_RT_Diag::intr_count, _CTDB_LCTDBRTDIAG_Tlm::intr_count, _CTDB_LCTDBRTDIAG_Tlm::pad_16, _test_config::rt, RT_APID_HKP, RT_SIZE_HKP, _test_config::seq, _CTDB_RT_Diag::telem_byte_count, _CTDB_LCTDBRTDIAG_Tlm::telem_byte_count, _CTDB_RT_Diag::telem_pkt_count, and _CTDB_LCTDBRTDIAG_Tlm::telem_pkt_count.
Referenced by rt_hkp().
int rt_start | ( | void | ) |
Starts the remote terminal.
0 | Success. | |
-1 | Failure. |
References CTDB_rtStart(), _test_config::rt, RT_CMD_RECV_NAME, RT_CMD_RECV_PRI, rt_pkt_cmd_rx(), and _test_config::task.
int rt_stop | ( | void | ) |
Stops the remote terminal.
0 | Success. | |
-1 | Failure. |
References CTDB_rtStop(), _test_config::exit, _test_config::rt, and _test_config::task.
busConfig [static] |
The RT driver 1553 bus configuration.
cbConfig [static] |
Initial value:
{ rt_null_hkp, NULL }
Config [static] |
The test configuration structure.
pktConfig [static] |
Initial value:
{ 32, CTDB_CONFIG_PKT_SIZE_CMD_RX, 8, 4, CTDB_CONFIG_PKT_SIZE_CMD_TX, 32, 128, CTDB_CONFIG_PKT_SIZE_TELEM, CTDB_CONFIG_PKT_SIZE_HKP }
taskConfig [static] |
Initial value:
{ { SUMT_RT_TASK_NAME, SUMT_RT_TASK_PRI, 0, NULL, SUMT_RT_TASK_STACK }, MSG_LVL_INFORMATION, }