GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> CTDB / V5-5-6 > ctdb_com_test_poll / rad750
#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 |
#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().
The typedef for _test_config.
int rt_exit | ( | void | ) |
Stops the test application and releases resources.
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.
addr | The remote terminal address. |
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.
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] |
Handles diagnostics communications test telecommands (func code = 0).
cmdPkt | A pointer to the telecommand packet buffer. |
References _test_config::cmd_hdr_size, _TC_Com_Test_Param::flags, FUNC_CODE_LAT_DIAG_COM_TEST, _test_config::hkp_param, _test_config::pat_data, _TC_Com_Test_Param::resp_count, _TC_Com_Test_Param::resp_length, TC_COM_TEST_DATA_SIZE, TC_COM_TEST_M_PAT_LENGTH, TC_COM_TEST_M_PAT_SELECT, TC_COM_TEST_M_RESP_TYPE, TC_COM_TEST_PARAM_SIZE, TC_COM_TEST_S_PAT_LENGTH, TC_COM_TEST_S_PAT_SELECT, and TC_COM_TEST_S_RESP_TYPE.
Referenced by rt_pkt_cmd_rx().
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.
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] |
Generates HKP telemetry packets. If a requested HKP communications test response is outstanding, one HKP telemetry packet is delivered.
References APID_TLM_LAT_COM_TEST_HKP, _TLM_Com_Test_Item::flags, _TC_Com_Test_Param::flags, _test_config::hkp_param, _TLM_Com_Test_Item::resp_count, _TC_Com_Test_Param::resp_count, _TC_Com_Test_Param::resp_length, _TLM_Com_Test_Item::resp_length, _test_config::rt, rt_pkt_fill(), _test_config::seq_hkp, SUMT_rtPollTelem(), TC_COM_TEST_M_PAT_LENGTH, TC_COM_TEST_M_PAT_SELECT, TC_COM_TEST_S_PAT_LENGTH, TC_COM_TEST_S_PAT_SELECT, _test_config::telem_buf, _test_config::telem_pkt, _test_config::time_sec, TLM_COM_TEST_HKP_SIZE, TLM_COM_TEST_ITEM_SIZE, _test_config::tlm_hdr_size, _TC_Com_Test_Param::unit, and _TLM_Com_Test_Item::unit.
Referenced by rt_poll().
static void rt_pkt_sc | ( | unsigned char * | cmdPkt | ) | [static] |
Handles diagnostics SC broadcase telecommands.
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.
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.
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.
0 | Success. | |
-1 | Failure. |
References _test_config::exit, and _test_config::task.
busConfig [static] |
The RT driver 1553 bus configuration.
Config [static] |
The test configuration structure.