GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> DDT / V1-1-1 > ddt_scp / rad750
#include <stdlib.h>
#include <MSG/MSG_pubdefs.h>
#include <CCSDS/CCSDS_pkt.h>
#include <CCSDS/CCSDS_swap.h>
#include <DDT/DDT_scpside.h>
#include <FBS/FBS_pubrtos.h>
#include <ITC/ITC_dump.h>
#include <ITC/ITC_pubdefs.h>
#include <DDT/DDT_msgs.h>
#include <PBS/BSWP.h>
#include <PBS/MBA.h>
#include <CLI/CLI_pubdefs.h>
Classes | |
struct | _Ddt_Field |
Description of a command packet field. More... | |
struct | _Ddt_Parm |
Description of a command parameter. More... | |
Defines | |
#define | DDT_APID_WRITE_FILE (1602) |
#define | DDT_FC_WRITE_FILE (0) |
Typedefs | |
typedef void(* | DDT_DumpCB )(char *pkt) |
DDT command dump callback pointer. | |
typedef struct _Ddt_Field | Ddt_Field |
Typedef for _Ddt_Field. | |
typedef struct _Ddt_Parm | Ddt_Parm |
Typedef for _Ddt_Parm. | |
Functions | |
static void | ddt_dump_boilerplate (char *pkt_name) |
Display some boilerplate header information. | |
static void | ddt_interp_file_id (unsigned int value) |
Interpret a file ID field value. | |
static void | ddt_interp_unit (unsigned int value) |
Interpret a LAT unit field value. | |
static void | ddt_show_field (unsigned char *pay, unsigned int start_byte, unsigned int end_byte, unsigned int start_bit, unsigned int end_bit, char *desc_p, void(*interp_p)(unsigned int val)) |
Show a field from a packet. | |
static unsigned int | ddt_dump_fields (Ddt_Field *field_p, unsigned int num_fields, unsigned char *pkt_p, unsigned int start_byte) |
Dump packet fields. | |
static void | ddt_dumpWriteFile (char *pkt) |
Dump the Write-FIle command. | |
static void | ddt_free_cb (ITC_QueueItem *qitem_p, unsigned int status, void *parm_0, void *parm_1, void *parm_2, unsigned int tx) |
ITC callback to free command packet memory. | |
static unsigned int | ddt_send_command (unsigned int num_parms, unsigned int *parm_bytes, unsigned int *parm_values, unsigned int apid, unsigned int func_code, DDT_DumpCB dump_func_p) |
Send a DDT command. | |
unsigned int | DDT_sendWriteFile (unsigned int lat_unit, unsigned int device, unsigned int dir, unsigned int file) |
Send the Write-File command. | |
static unsigned int | ddt_get_parms (CLI_Control *cli, Ddt_Parm *parm_p, unsigned int num_parms, char *usage) |
Get command-line parameters. | |
static unsigned int | ddt_sendWriteFile_cli (CLI_Control *cli, void *prm) |
CLI callback for the "DDT_sendWriteFile" command. | |
unsigned int | DDT_addSyntaxSCP (CLI_Syntax *syntax) |
Add DDT commands to the command-line syntax. |
** CVS $Id: DDT_scp.c,v 1.2 2011/03/30 01:15:05 apw Exp $ **
These functions use standard ITC functions to send DDT telecommands to an SIU.
unsigned int DDT_addSyntaxSCP | ( | CLI_Syntax * | syntax | ) |
Add DDT commands to the command-line syntax.
syntax | Syntax handle. |
References ddt_sendWriteFile_cli().
void ddt_dump_boilerplate | ( | char * | pkt_name | ) | [static] |
Display some boilerplate header information.
pkt_name | Packet description string. |
Referenced by ddt_dumpWriteFile().
unsigned int ddt_dump_fields | ( | Ddt_Field * | field_p, | |
unsigned int | num_fields, | |||
unsigned char * | pkt_p, | |||
unsigned int | start_byte | |||
) | [static] |
Dump packet fields.
field_p | Pointer to first field description. | |
num_fields | Number of fields to dump. | |
pkt_p | Pointer to packet. | |
start_byte | Starting offset within the packet. |
References ddt_show_field(), _Ddt_Field::desc_p, _Ddt_Field::interp_p, _Ddt_Field::num_bits, and _Ddt_Field::num_bytes.
Referenced by ddt_dumpWriteFile().
void ddt_dumpWriteFile | ( | char * | pkt | ) | [static] |
Dump the Write-FIle command.
pkt | Pointer to CCSDS packet. |
References ddt_dump_boilerplate(), ddt_dump_fields(), ddt_interp_file_id(), and ddt_interp_unit().
Referenced by DDT_sendWriteFile().
void ddt_free_cb | ( | ITC_QueueItem * | qitem_p, | |
unsigned int | status, | |||
void * | parm_0, | |||
void * | parm_1, | |||
void * | parm_2, | |||
unsigned int | tx | |||
) | [static] |
ITC callback to free command packet memory.
qitem_p | Pointer to packet's queue item. | |
status | Status of packet transmission. | |
parm_0 | Callback parameter 0 - first item to free. | |
parm_1 | Callback parameter 1 - second item to free. | |
parm_2 | Callback parameter 2 - third item to free. | |
tx | Flag to indicate sender-side failure (unused). |
Referenced by ddt_send_command().
unsigned int ddt_get_parms | ( | CLI_Control * | cli, | |
Ddt_Parm * | parm_p, | |||
unsigned int | num_parms, | |||
char * | usage | |||
) | [static] |
Get command-line parameters.
cli | CLI control handle. | |
parm_p | Pointer to first parameter description. | |
num_parms | Number of parameters to get. | |
usage | Usage description. |
0 | Success. | |
Nonzero | Failure. |
References _Ddt_Parm::value.
Referenced by ddt_sendWriteFile_cli().
void ddt_interp_file_id | ( | unsigned int | value | ) | [static] |
Interpret a file ID field value.
value | Value to interpret. |
Referenced by ddt_dumpWriteFile().
void ddt_interp_unit | ( | unsigned int | value | ) | [static] |
Interpret a LAT unit field value.
value | Value to interpret. |
Referenced by ddt_dumpWriteFile().
unsigned int ddt_send_command | ( | unsigned int | num_parms, | |
unsigned int * | parm_bytes, | |||
unsigned int * | parm_values, | |||
unsigned int | apid, | |||
unsigned int | func_code, | |||
DDT_DumpCB | dump_func_p | |||
) | [static] |
Send a DDT command.
num_parms | Number of command parameters. | |
parm_bytes | Pointer to array of parameter sizes, in bytes. | |
parm_values | Pointer to array of parameter values. | |
apid | APID of the command. | |
func_code | Function code of the command. | |
dump_func_p | Pointer to function that dumps the command payload. |
References ddt_free_cb().
Referenced by DDT_sendWriteFile().
unsigned int DDT_sendWriteFile | ( | unsigned int | lat_unit, | |
unsigned int | device, | |||
unsigned int | dir, | |||
unsigned int | file | |||
) |
Send the Write-File command.
lat_unit | ID of the target unit (0=SIU, 1=EPU0, 2=EPU1, 3=EPU2). | |
device | Device number for the file to write. | |
dir | Directory number for the file to write. | |
file | File number for the file to write. |
0 | Success. | |
Nonzero | Failure. |
References ddt_dumpWriteFile(), and ddt_send_command().
Referenced by ddt_sendWriteFile_cli().
unsigned int ddt_sendWriteFile_cli | ( | CLI_Control * | cli, | |
void * | prm | |||
) | [static] |
CLI callback for the "DDT_sendWriteFile" command.
cli | CLI control handle. | |
prm | User parameter (unused). |
0 | Success. | |
Nonzero | Failure. |
References ddt_get_parms(), and DDT_sendWriteFile().
Referenced by DDT_addSyntaxSCP().
void ddt_show_field | ( | unsigned char * | pay, | |
unsigned int | start_byte, | |||
unsigned int | end_byte, | |||
unsigned int | start_bit, | |||
unsigned int | end_bit, | |||
char * | desc_p, | |||
void(*)(unsigned int val) | interp_p | |||
) | [static] |
Show a field from a packet.
pay | Pointer to packet buffer. | |
start_byte | First byte of the value within the packet. | |
end_byte | Last byte of the value within the packet. | |
start_bit | First bit of the field within the value. | |
end_bit | Last bit of the field within the value. | |
desc_p | Pointer to field description string. | |
interp_p | Pointer to field interpretation function. |
Referenced by ddt_dump_fields().