GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> LIM / V1-22-4 > lim / mv2304


Interface   Data Structures   File List   Data Fields   Globals  

LIM_control.c File Reference

Control the operation of the LIM functions. More...

#include <string.h>
#include <CDM/CDM_pubdefs.h>
#include <LIM/LIM_msgs.h>
#include <LIM/LIM_pubdefs.h>
#include <LIM_DB/LIM_DB_schema.h>
#include <MSG/MSG_pubdefs.h>
#include <PBS/TASK.h>
#include <LIM_action.h>
#include <LIM_gbm.h>
#include <LIM_intercept.h>
#include <LIM_lci.h>
#include <LIM_lpa.h>
#include <LIM_mode.h>
#include <LIM_pid.h>
#include <LIM_pig.h>
#include <LIM_pkt_send.h>
#include <LIM_pool.h>
#include <LIM_sc.h>
#include <LIM_task.h>

Classes

struct  _LIM_Control
 Control information specific to the LIM task. More...

Defines

#define LIM_APID_GBM   (0x660)
#define LIM_APID_LCI   (0x67c)
#define LIM_APID_LPA   (0x674)
#define LIM_APID_LPA_IDLE   (0x675)
#define LIM_APID_LTC   (0x658)

Typedefs

typedef struct _LIM_Control LIM_Control
 Typedef for _LIM_Control.

Functions

static const LIM_DB_Schema * lim_get_db (int report_error)
 Return a pointer to the LIM configuration database.
unsigned int LIM_initialize (ITC_TaskID tid)
 Initialize the LIM package.
unsigned int LIM_init_with_db (void)
 Initialize the LIM package using CDM.
static unsigned int lim_delete_pkt_send (LIM_Pkt_Send *pkt_send_p)
 Delete a packet sending object.
unsigned int LIM_shutdown (void)
 Shutdown the LIM package.
unsigned int LIM_start (TASK_attr *attr_p)
 Start the LIM task.
unsigned int LIM_start_with_db (void)
 Start the LIM task using CDM.
unsigned int LIM_stop (void)
 Stop the LIM task.
unsigned int LIM_get_info (LIM_Info *info_p)
 Get current LIM state information.
unsigned int LIM_capture_cal (unsigned int apid, int start_fc, int abort_fc)
 Capture calibration telecommands with the specified APID.
unsigned int LIM_capture_cal_with_db (void)
 Capture calibration telecommands using the LIM_DB configuration.
unsigned int LIM_capture_diag (unsigned int apid, int start_fc, int abort_fc)
 Capture diagnostic telecommands with the specified APID.
unsigned int LIM_capture_diag_with_db (void)
 Capture diagnostic telecommands using the LIM_DB configuration.
unsigned int LIM_capture_physics (unsigned int apid, int start_fc, int config_fc, int stop_fc)
 Capture physics telecommands with the specified APID.
unsigned int LIM_capture_physics_with_db (void)
 Capture physics telecommands using the LIM_DB configuration.

Variables

LIM_TaskLim_control_p = NULL
 Pointer to the LIM task control information.
static unsigned int Lim_def_physics_apids []
 List of default Physics APIDs to capture.
static unsigned int Lim_def_cal_apids []
 List of default Calibration APIDs to capture.
static const LIM_DB_Schema Lim_def_db
 Default LIM configuration database.


Detailed Description

Control the operation of the LIM functions.

**  CVS $Id: LIM_control.c,v 1.32 2011/03/29 21:20:28 apw Exp $
**  

Control functions for the LIM package.


Function Documentation

unsigned int LIM_capture_cal ( unsigned int  apid,
int  start_fc,
int  abort_fc 
)

Capture calibration telecommands with the specified APID.

This function instructs LIM to capture calibration telecommands with the specified APID. If non-negative, LIM handles the telecommands with the start_fc function code as Calibration-Start commands. Likewise, if abort_fc is non-negative, LIM handles the telecommands with that function code as Calibration-Abort commands.

Parameters:
apid APID to capture.
start_fc Func code of Calibration-Start cmd (-1 if none).
abort_fc Func code of Calibration-Abort cmd (-1 if none).
Returns:
Zero if successful.

A MSG code if an error occurs.

References LIM_intercept_cal(), LIM_task_check_state(), LIM_task_get_extra_ptr(), and LIM_TASK_STATE_INITIALIZED.

Referenced by LIM_capture_cal_with_db().

unsigned int LIM_capture_cal_with_db ( void   ) 

Capture calibration telecommands using the LIM_DB configuration.

This function is a wrapper for LIM_capture_cal() that uses the LIM_DB configuration database to determine its parameters.

Returns:
Zero if successful.

A MSG code if an error occurs.

References LIM_capture_cal(), lim_get_db(), LIM_lci_abort_fcode(), and LIM_lci_start_fcode().

unsigned int LIM_capture_diag ( unsigned int  apid,
int  start_fc,
int  abort_fc 
)

Capture diagnostic telecommands with the specified APID.

This function instructs LIM to capture diagnostic telecommands with the specified APID. If non-negative, LIM handles the telecommands with the start_fc function code as Diagnostic-Start commands. Likewise, if abort_fc is non-negative, LIM handles the telecommands with that function code as Diagnostic-Abort commands.

Parameters:
apid APID to capture.
start_fc Func code of Diagnostic-Start command (-1 if none).
abort_fc Func code of Diagnostic-Abort command (-1 if none).
Returns:
Zero if successful.

A MSG code if an error occurs.

References LIM_task_check_state(), LIM_task_get_extra_ptr(), and LIM_TASK_STATE_INITIALIZED.

Referenced by LIM_capture_diag_with_db().

unsigned int LIM_capture_diag_with_db ( void   ) 

Capture diagnostic telecommands using the LIM_DB configuration.

This function is a wrapper for LIM_capture_diag() that uses the LIM_DB configuration database to determine its parameters.

Returns:
Zero if successful.

A MSG code if an error occurs.

References LIM_capture_diag(), and lim_get_db().

unsigned int LIM_capture_physics ( unsigned int  apid,
int  start_fc,
int  config_fc,
int  stop_fc 
)

Capture physics telecommands with the specified APID.

This function instructs LIM to capture physics observation telecommands with the specified APID. If non-negative, LIM handles the telecommand with the start_fc function code as the Physics-Start command. Likewise, if config_fc or stop_fc is non-negative, LIM handles the telecommands with those function codes as the Physics-Config and Physics-Abort commands.

Parameters:
apid APID to capture.
start_fc Function code of Physics-Start cmd (-1 if none).
config_fc Function code of Physics-Config cmd (-1 if none).
stop_fc Function code of Physics-Stop cmd (-1 if none).
Returns:
Zero if successful.

A MSG code if an error occurs.

This function instructs LIM to capture physics observation telecommands with the specified APID. If non-negative, LIM handles the telecommand with the start_fc function code as the Physics-Start command. Likewise, if config_fc or stop_fc is non-negative, LIM handles the telecommands with those function codes as the Physics-Reconfig and Physics-Abort commands.

Parameters:
apid APID to capture.
start_fc Function code of Physics-Start cmd (-1 if none).
config_fc Function code of Physics-Config cmd (-1 if none).
stop_fc Function code of Physics-Stop cmd (-1 if none).
Returns:
Zero if successful.

A MSG code if an error occurs.

References LIM_intercept_physics(), LIM_task_check_state(), LIM_task_get_extra_ptr(), and LIM_TASK_STATE_INITIALIZED.

unsigned int LIM_capture_physics_with_db ( void   ) 

Capture physics telecommands using the LIM_DB configuration.

This function is similar to LIM_capture_physics() except that it uses the LIM_DB configuration database to determine its parameters.

Returns:
Zero if successful.

A MSG code if an error occurs.

References LIM_gbm_calcinfo_fcode(), LIM_gbm_closeout_fcode(), LIM_gbm_repoint_fcode(), lim_get_db(), LIM_intercept_gbm(), LIM_intercept_physics(), LIM_intercept_physics_idle(), LIM_lpa_config_fcode(), LIM_lpa_start_fcode(), LIM_lpa_stop_fcode(), LIM_task_check_state(), LIM_task_get_extra_ptr(), and LIM_TASK_STATE_INITIALIZED.

unsigned int lim_delete_pkt_send ( LIM_Pkt_Send pkt_send_p  )  [static]

Delete a packet sending object.

Parameters:
pkt_send_p Pointer to packet sending object.
Returns:
MSG code.

References LIM_pkt_send_delete().

Referenced by LIM_shutdown().

LIM_DB_Schema * lim_get_db ( int  report_error  )  [static]

Return a pointer to the LIM configuration database.

This function returns a pointer to the LIM_DB configuration database. If CDM can't find the database, this function returns a pointer to the default database.

Parameters:
report_error Flag to enable error reporting.
Returns:
Pointer to LIM configuration database.

References Lim_def_db.

Referenced by LIM_capture_cal_with_db(), LIM_capture_diag_with_db(), LIM_capture_physics_with_db(), LIM_initialize(), and LIM_start().

unsigned int LIM_get_info ( LIM_Info info_p  ) 

Get current LIM state information.

This function returns selected items from the current LIM state.

Parameters:
info_p Location to return state information (must not be NULL).
Returns:
Zero if successful.

A MSG code if an error occurs.

References LIM_action_get_info(), LIM_mode_get_info(), LIM_task_get_extra_ptr(), LIM_task_lock_access(), and LIM_task_unlock_access().

Referenced by LIM_action_report().

unsigned int LIM_init_with_db ( void   ) 

Initialize the LIM package using CDM.

This function is a wrapper for LIM_initialize that uses CDM to determine its parameters.

Returns:
Zero if successful.

A MSG code if an error occurs.

References LIM_initialize().

unsigned int LIM_initialize ( ITC_TaskID  tid  ) 

Initialize the LIM package.

This function initializes the LIM package using the functions found in LIM_task.c. It should be the first LIM function called when using the LIM package.

Parameters:
tid ID of the LIM task.
Returns:
Zero if successful.

A MSG code if an error occurs.

References LIM_action_new(), lim_get_db(), LIM_intercept_new(), LIM_mode_new(), LIM_pkt_send_new(), LIM_pool_alloc(), LIM_pool_init(), LIM_task_add_queue(), LIM_task_get_extra_ptr(), LIM_task_init_begin_with_db(), and LIM_task_init_end().

Referenced by LIM_init_with_db().

unsigned int LIM_shutdown ( void   ) 

Shutdown the LIM package.

This function shuts down the LIM package using the functions found in LIM_task.c. This function should be the last function called when the LIM package is no longer needed.

Returns:
Zero if successful.

A MSG code if an error occurs.

This function shuts down the LIM package using the functions found in LIM_task.c. It can be called only if the current LIM task state is INITIALIZED, INIT_FAIL, or SHUTDOWN_FAIL. This function should be called when the LIM package is no longer needed.

Returns:
Zero if successful.

A MSG code if an error occurs.

References LIM_action_delete(), lim_delete_pkt_send(), LIM_intercept_delete(), LIM_mode_delete(), LIM_pool_alloc(), LIM_pool_shutdown(), LIM_task_get_extra_ptr(), LIM_task_remove_queue(), LIM_task_shutdown_begin(), and LIM_task_shutdown_end().

unsigned int LIM_start ( TASK_attr *  attr_p  ) 

Start the LIM task.

This function starts the LIM task and transitions LIM to the STARTED state. It can be called only if the current LIM state is INITIALIZED. This function should be called after LIM_initialize().

Parameters:
attr_p Pointer to task attributes. CPU_DB task attributes will be used if this value is NULL.
Returns:
Zero if successful.

A MSG code if an error occurs.

References LIM_action_report(), LIM_ACTION_START, lim_get_db(), LIM_pid_select(), LIM_task_get_extra_ptr(), and LIM_task_start_with_db().

Referenced by LIM_start_with_db().

unsigned int LIM_start_with_db ( void   ) 

Start the LIM task using CDM.

This function is a wrapper for LIM_start that uses CDM to determine its parameters.

Returns:
Zero if successful.

A MSG code if an error occurs.

References LIM_start().

unsigned int LIM_stop ( void   ) 

Stop the LIM task.

This function stops the LIM task and transitions LIM back to the INITIALIZED state. It can be called only if the current LIM state is STARTED, START_FAIL, or STOP_FAIL. This function should be called before LIM_shutdown().

Returns:
Zero if successful.

A MSG code if an error occurs.

This function stops the LIM task and transitions LIM back to the INITIALIZED state. It can be called only if the current LIM state is STARTED, START_FAIL, or STOP_FAIL. This function should be called before LIM_shutdown().

Returns:
Zero if successful.

A MSG code if an error occurs.

References LIM_action_report(), LIM_ACTION_STOP, LIM_task_get_extra_ptr(), and LIM_task_stop().


Variable Documentation

unsigned int Lim_def_cal_apids[] [static]

Initial value:

 
    {
        LIM_APID_LCI,                   
    }
List of default Calibration APIDs to capture.

unsigned int Lim_def_physics_apids[] [static]

Initial value:

 
    {
        LIM_APID_GBM,                   
        LIM_APID_LPA,                   
        LIM_APID_LPA_IDLE,              
    }
List of default Physics APIDs to capture.


Generated on Wed Nov 21 21:17:39 2012 by  doxygen 1.5.8