GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> PBC / V4-12-3 > pbc_scp / sun-gcc


Interface   Data Structures   File List   Data Fields   Globals  

PBC_scpside.c File Reference

SCP side of PBC command and telemetry handling. More...

#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.


Detailed Description

SCP side of PBC command and telemetry handling.

  CVS $Id: PBC_scpside.c,v 1.17 2011/03/29 23:14:59 apw Exp $
  

Send PBC commands and handle boot housekeeping telemetry.


Function Documentation

unsigned int PBC_addSyntaxSCP ( CLI_Syntax *  syntax  ) 

Add PBC commands to the command-line syntax.

Parameters:
syntax Syntax handle.
Returns:
MSG code.

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 
)

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.

Parameters:
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).
Returns:
Nothing.

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.

Parameters:
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.
Return values:
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.

Parameters:
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, ...).
Returns:
MSG code.

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.

Parameters:
cli CLI control handle.
prm User parameter (unused).
Return values:
0 Success.
Nonzero Failure.

References PBC_sendBoot().

Referenced by PBC_addSyntaxSCP().

unsigned int PBC_sendErrDump ( unsigned short  unit  ) 

Send the Boot Error Dump command.

Parameters:
unit LAT unit to receive the command (0 => SIU, 1 => EPU0, ...).
Returns:
MSG code.

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.

Parameters:
cli CLI control handle.
prm User parameter (unused).
Return values:
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.

Parameters:
unit LAT unit to receive the command (0 => SIU, 1 => EPU0, ...).
flags Primary boot flags.
Returns:
MSG code.

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.

Parameters:
cli CLI control handle.
prm User parameter (unused).
Return values:
0 Success.
Nonzero Failure.

References PBC_sendReset().

Referenced by PBC_addSyntaxSCP().

unsigned int PBC_sendStart ( unsigned short  unit  ) 

Send the Boot Start command.

Parameters:
unit LAT unit to receive the command (0 => SIU, 1 => EPU0, ...).
Returns:
MSG code.

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.

Parameters:
cli CLI control handle.
prm User parameter (unused).
Return values:
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.

Parameters:
level Level of verbosity - set higher to display more.
Returns:
Previous verbosity level.

Referenced by PBC_setDisplayLevelCmd_cli().

unsigned int PBC_setDisplayLevelCmd_cli ( CLI_Control *  cli,
void *  prm 
) [static]

CLI callback for the "PBC_setDisplayLevelCmd" command.

Parameters:
cli CLI control handle.
prm User parameter (unused).
Return values:
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.

Parameters:
level Level of verbosity - set higher to display more.
Returns:
Previous verbosity level.

Referenced by PBC_setDisplayLevelTlm_cli().

unsigned int PBC_setDisplayLevelTlm_cli ( CLI_Control *  cli,
void *  prm 
) [static]

CLI callback for the "PBC_setDisplayLevelTlm" command.

Parameters:
cli CLI control handle.
prm User parameter (unused).
Return values:
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.

Parameters:
enable Enable flag - set to nonzero to enable throttling.
Returns:
Previous throttle flag value.

unsigned int PBC_setDumpDisplayLimit_cli ( CLI_Control *  cli,
void *  prm 
) [static]

CLI callback for the "PBC_setDumpDisplayLimit" command.

Parameters:
cli CLI control handle.
prm User parameter (unused).
Return values:
0 Success.
Nonzero Failure.

References PBC_setDumpDisplayLimit().

Referenced by PBC_addSyntaxSCP().


Variable Documentation

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.

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.

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.


Generated on Sat Apr 9 23:15:55 2011 by  doxygen 1.5.8