GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> PBC / V4-12-3 > pbc_scp / sun-gcc
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <MSG/MSG_pubdefs.h>
#include <CCSDS/CCSDS_pkt.h>
#include <CCSDS/CCSDS_swap.h>
#include <ITC/ITC_dump.h>
#include <ITC/ITC_pubdefs.h>
#include <PBC/PBC_dump.h>
#include <PBC/PBC_msgs.h>
#include <PBC/PBC_scpside.h>
#include <PBC/PBC_tlmdefs.h>
#include <PBS/BSWP.h>
#include <PBS/MBA.h>
#include <PBS/SPIN.h>
#include <BootDiagnostics.h>
#include <CLI/CLI_pubdefs.h>
Typedefs | |
typedef void(* | PBC_DumpCB )(char *pkt) |
PBC command dump callback pointer. | |
Functions | |
int | PBC_setDisplayLevelCmd (int level) |
Set the verbosity level of the PBC command display. | |
int | PBC_setDisplayLevelTlm (int level) |
Set the verbosity level of the PBC telemetry display. | |
int | PBC_setDisplayThrottleTlm (int enable) |
Set the throttle flag for the PBC telemetry display. | |
unsigned int | PBC_dispatchTlm (void *prm, unsigned char *pkt) |
Dispatch routine for arriving boot housekeeping telemetry. | |
static void | pbc_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 | pbc_send_command (unsigned int num_parms, unsigned int *parm_bytes, unsigned int *parm_values, unsigned int func_code, PBC_DumpCB dump_func_p) |
Send a PBC command. | |
unsigned int | PBC_sendBoot (unsigned short unit, unsigned short rtos, unsigned short ssb0, unsigned short ssb1) |
Send the Boot RTOS Execute command. | |
unsigned int | PBC_sendErrDump (unsigned short unit) |
Send the Boot Error Dump command. | |
unsigned int | PBC_sendReset (unsigned short unit, unsigned int flags) |
Send the Boot Reset command. | |
unsigned int | PBC_sendStart (unsigned short unit) |
Send the Boot Start command. | |
static unsigned int | PBC_sendBoot_cli (CLI_Control *cli, void *prm) |
CLI callback for the "PBC_sendBoot" command. | |
static unsigned int | PBC_sendErrDump_cli (CLI_Control *cli, void *prm) |
CLI callback for the "PBC_sendErrDump" command. | |
static unsigned int | PBC_sendReset_cli (CLI_Control *cli, void *prm) |
CLI callback for the "PBC_sendReset" command. | |
static unsigned int | PBC_sendStart_cli (CLI_Control *cli, void *prm) |
CLI callback for the "PBC_sendStart" command. | |
static unsigned int | PBC_setDisplayLevelCmd_cli (CLI_Control *cli, void *prm) |
CLI callback for the "PBC_setDisplayLevelCmd" command. | |
static unsigned int | PBC_setDisplayLevelTlm_cli (CLI_Control *cli, void *prm) |
CLI callback for the "PBC_setDisplayLevelTlm" command. | |
static unsigned int | PBC_setDumpDisplayLimit_cli (CLI_Control *cli, void *prm) |
CLI callback for the "PBC_setDumpDisplayLimit" command. | |
unsigned int | PBC_addSyntaxSCP (CLI_Syntax *syntax) |
Add PBC commands to the command-line syntax. | |
Variables | |
int | PBC_displayLevelCmd = 1 |
The verbosity level of the PBC command display. | |
int | PBC_displayLevelTlm = 4 |
The verbosity level of the PBC telemetry display. | |
int | PBC_displayThrottleTlm = 1 |
The throttle flag for the PBC telemetry display. |
CVS $Id: PBC_scpside.c,v 1.17 2011/03/29 23:14:59 apw Exp $
Send PBC commands and handle boot housekeeping telemetry.
unsigned int PBC_addSyntaxSCP | ( | CLI_Syntax * | syntax | ) |
Add PBC commands to the command-line syntax.
syntax | Syntax handle. |
References PBC_sendBoot_cli(), PBC_sendErrDump_cli(), PBC_sendReset_cli(), PBC_sendStart_cli(), PBC_setDisplayLevelCmd_cli(), PBC_setDisplayLevelTlm_cli(), and PBC_setDumpDisplayLimit_cli().
unsigned int PBC_dispatchTlm | ( | void * | prm, | |
unsigned char * | pkt | |||
) |
Dispatch routine for arriving boot housekeeping telemetry.
prm | User parameter (unused). | |
pkt | Pointer to CCSDS packet. |
References _PBC_LBTHKP_Tlm::bootSoftwareMode, _PBC_LBTHKP_Tlm::bootType, _PBC_LBTHKP_Tlm::errorWord, _PBC_LBTHKP_Tlm::fileUploadPktCnt, _PBC_LBTHKP_Tlm::fileUploadState, _PBC_LBTHKP_Tlm::lastCommand, _PBC_LBTHKP_Tlm::latestErrorWord, _PBC_LBTHKP_Tlm::memDumpAddress, _PBC_LBTHKP_Tlm::memDumpData, _PBC_LBTHKP_Tlm::memDumpWordCount, PBC_dumpHouse(), PBC_dumpHouseBgHigh(), PBC_dumpHouseBgLow(), PBC_dumpHouseData(), _PBC_LBTHKP_Tlm::queuedErrorCount, _PBC_LBTHKP_Tlm::scrubAddrHi, _PBC_LBTHKP_Tlm::tcPktAcceptCount, _PBC_LBTHKP_Tlm::tcPktReceiveCount, _PBC_LBTHKP_Tlm::tcPktScCount, _PBC_LBTHKP_Tlm::tcPktUnsupportCount, _PBC_LBTHKP_Tlm::totalErrorCount, and _PBC_BOOTCOMMAND::us.
void pbc_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 indicating sender-side failure (unused). |
Referenced by pbc_send_command().
unsigned int pbc_send_command | ( | unsigned int | num_parms, | |
unsigned int * | parm_bytes, | |||
unsigned int * | parm_values, | |||
unsigned int | func_code, | |||
PBC_DumpCB | dump_func_p | |||
) | [static] |
Send a PBC 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. | |
func_code | Function code of the command. | |
dump_func_p | Pointer to function that dumps the command payload. |
0 | Success. | |
Nonzero | Failure. |
References pbc_free_cb().
Referenced by PBC_sendBoot(), PBC_sendErrDump(), PBC_sendReset(), and PBC_sendStart().
unsigned int PBC_sendBoot | ( | unsigned short | unit, | |
unsigned short | rtos, | |||
unsigned short | ssb0, | |||
unsigned short | ssb1 | |||
) |
Send the Boot RTOS Execute command.
unit | LAT unit to receive the command (0 => SIU, 1 => EPU0, ...). | |
rtos | Location of RTOS (0 => RAM, 1 => EE lower, 2 => EE upper). | |
ssb0 | Location of SBC module 0 (0 => RAM, 1 => EE lower, ...). | |
ssb1 | Location of SBC module 1 (0 => RAM, 1 => EE lower, ...). |
References PBC_dumpBoot(), and pbc_send_command().
Referenced by PBC_sendBoot_cli().
unsigned int PBC_sendBoot_cli | ( | CLI_Control * | cli, | |
void * | prm | |||
) | [static] |
CLI callback for the "PBC_sendBoot" command.
cli | CLI control handle. | |
prm | User parameter (unused). |
0 | Success. | |
Nonzero | Failure. |
References PBC_sendBoot().
Referenced by PBC_addSyntaxSCP().
unsigned int PBC_sendErrDump | ( | unsigned short | unit | ) |
Send the Boot Error Dump command.
unit | LAT unit to receive the command (0 => SIU, 1 => EPU0, ...). |
References PBC_dumpErrDump(), and pbc_send_command().
Referenced by PBC_sendErrDump_cli().
unsigned int PBC_sendErrDump_cli | ( | CLI_Control * | cli, | |
void * | prm | |||
) | [static] |
CLI callback for the "PBC_sendErrDump" command.
cli | CLI control handle. | |
prm | User parameter (unused). |
0 | Success. | |
Nonzero | Failure. |
References PBC_sendErrDump().
Referenced by PBC_addSyntaxSCP().
unsigned int PBC_sendReset | ( | unsigned short | unit, | |
unsigned int | flags | |||
) |
Send the Boot Reset command.
unit | LAT unit to receive the command (0 => SIU, 1 => EPU0, ...). | |
flags | Primary boot flags. |
References PBC_dumpReset(), and pbc_send_command().
Referenced by PBC_sendReset_cli().
unsigned int PBC_sendReset_cli | ( | CLI_Control * | cli, | |
void * | prm | |||
) | [static] |
CLI callback for the "PBC_sendReset" command.
cli | CLI control handle. | |
prm | User parameter (unused). |
0 | Success. | |
Nonzero | Failure. |
References PBC_sendReset().
Referenced by PBC_addSyntaxSCP().
unsigned int PBC_sendStart | ( | unsigned short | unit | ) |
Send the Boot Start command.
unit | LAT unit to receive the command (0 => SIU, 1 => EPU0, ...). |
References PBC_dumpStart(), and pbc_send_command().
Referenced by PBC_sendStart_cli().
unsigned int PBC_sendStart_cli | ( | CLI_Control * | cli, | |
void * | prm | |||
) | [static] |
CLI callback for the "PBC_sendStart" command.
cli | CLI control handle. | |
prm | User parameter (unused). |
0 | Success. | |
Nonzero | Failure. |
References PBC_sendStart().
Referenced by PBC_addSyntaxSCP().
int PBC_setDisplayLevelCmd | ( | int | level | ) |
Set the verbosity level of the PBC command display.
level | Level of verbosity - set higher to display more. |
Referenced by PBC_setDisplayLevelCmd_cli().
unsigned int PBC_setDisplayLevelCmd_cli | ( | CLI_Control * | cli, | |
void * | prm | |||
) | [static] |
CLI callback for the "PBC_setDisplayLevelCmd" command.
cli | CLI control handle. | |
prm | User parameter (unused). |
0 | Success. | |
Nonzero | Failure. |
References PBC_setDisplayLevelCmd().
Referenced by PBC_addSyntaxSCP().
int PBC_setDisplayLevelTlm | ( | int | level | ) |
Set the verbosity level of the PBC telemetry display.
level | Level of verbosity - set higher to display more. |
Referenced by PBC_setDisplayLevelTlm_cli().
unsigned int PBC_setDisplayLevelTlm_cli | ( | CLI_Control * | cli, | |
void * | prm | |||
) | [static] |
CLI callback for the "PBC_setDisplayLevelTlm" command.
cli | CLI control handle. | |
prm | User parameter (unused). |
0 | Success. | |
Nonzero | Failure. |
References PBC_setDisplayLevelTlm().
Referenced by PBC_addSyntaxSCP().
int PBC_setDisplayThrottleTlm | ( | int | enable | ) |
Set the throttle flag for the PBC telemetry display.
enable | Enable flag - set to nonzero to enable throttling. |
unsigned int PBC_setDumpDisplayLimit_cli | ( | CLI_Control * | cli, | |
void * | prm | |||
) | [static] |
CLI callback for the "PBC_setDumpDisplayLimit" command.
cli | CLI control handle. | |
prm | User parameter (unused). |
0 | Success. | |
Nonzero | Failure. |
References PBC_setDumpDisplayLimit().
Referenced by PBC_addSyntaxSCP().
int PBC_displayLevelCmd = 1 |
The verbosity level of the PBC command display.
This variable determines the amount of information that is displayed for each boot command that is sent. The higher the value, the more information that is displayed. Use PBC_setDisplayLevelCmd() to change this value.
int PBC_displayLevelTlm = 4 |
The verbosity level of the PBC telemetry display.
This variable determines the amount of information that is displayed for each boot housekeeping telemetry packet that is received. The higher the value, the more information that is displayed. Use PBC_setDisplayLevelTlm() to change this value.
int PBC_displayThrottleTlm = 1 |
The throttle flag for the PBC telemetry display.
This variable determines if PBC telemetry should be throttled such that no more than one packet is displayed per second.