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


Interface   Data Structures   File List   Data Fields   Globals  

LIM_other_task.c File Reference

Handle LIM interactions with other tasks. More...

#include <string.h>
#include <ITC/ITC_pubdefs.h>
#include <LIM/LIM_msgs.h>
#include <LIM/LIM_pubdefs.h>
#include <MSG/MSG_pubdefs.h>
#include <PBS/MBA.h>
#include <LIM_action.h>
#include <LIM_other_task.h>
#include <LIM_task.h>

Classes

struct  _LIM_Other
 State information for a LIM other task object. More...

Defines

#define LIM_OTHER_VALID_KEY   (('L'<<24)+('O'<<16)+('T'<<8)+'H')
 Value that indicates LIM other task object state is valid.

Functions

static unsigned int lim_other_check (LIM_Other *object_p)
 Validate a LIM other task object pointer.
static unsigned int lim_other_change_state (LIM_Other *object_p, LIM_Other_State new_state)
 Change the current state of another task.
unsigned int LIM_other_new (LIM_Other **object_pp, LIM_Task *task_p, LIM_Action *action_p, LIM_Pkt_Send *pkt_start_p, LIM_Pkt_Send *pkt_stop_p, LIM_Action_Id action_change, LIM_Action_Id action_start, LIM_Action_Id action_start_status, LIM_Action_Id action_restart, LIM_Action_Id action_stop, LIM_Action_Id action_stop_status, char *desc)
 Create and initialize a new other task object.
unsigned int LIM_other_delete (LIM_Other *object_p)
 Shutdown and delete an other task object.
LIM_Other_State LIM_other_get_state (LIM_Other *object_p)
 Return the current state of another task.
unsigned int LIM_other_check_state (LIM_Other *object_p, LIM_Other_State valid_1, LIM_Other_State valid_2)
 Determine if another task is in a valid state.
unsigned int LIM_other_fwd_active (LIM_Other *object_p, const ITC_QueueItem *qitem_p, LIM_Pkt_Send *pkt_send_p, LIM_Action_Id action)
 Forward an 'active' command to another task.
unsigned int LIM_other_fwd_idle (LIM_Other *object_p, const ITC_QueueItem *qitem_p, LIM_Pkt_Send *pkt_send_p, LIM_Action_Id action)
 Forward an 'idle' command to another task.
unsigned int LIM_other_fwd_stop (LIM_Other *object_p, const ITC_QueueItem *qitem_p, LIM_Pkt_Send *pkt_send_p)
 Forward a Stop command to another task.
unsigned int LIM_other_handle_bulk (LIM_Other *object_p, const ITC_QueueItem *qitem_p)
 Handle a message on the BULK queue.
unsigned int LIM_other_handle_complete (LIM_Other *object_p)
 Handle a Complete message from another task.
unsigned int LIM_other_send_start (LIM_Other *object_p, const unsigned char *pkt_p, unsigned int pkt_bytes)
 Send a Start command to another task.
unsigned int LIM_other_send_stop (LIM_Other *object_p, const unsigned char *pkt_p, unsigned int pkt_bytes)
 Send a Stop command to another task.


Detailed Description

Handle LIM interactions with other tasks.

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

Function Documentation

unsigned int lim_other_change_state ( LIM_Other object_p,
LIM_Other_State  new_state 
) [static]

Change the current state of another task.

Parameters:
object_p Pointer to other task object.
new_state New task state.
Returns:
MSG code.

References _LIM_Other::action_change, _LIM_Other::action_p, _LIM_Other::desc, LIM_action_report(), LIM_task_lock_access(), LIM_task_unlock_access(), _LIM_Other::state, and _LIM_Other::task_p.

Referenced by LIM_other_fwd_stop(), LIM_other_handle_bulk(), LIM_other_handle_complete(), LIM_other_send_start(), and LIM_other_send_stop().

unsigned int lim_other_check ( LIM_Other object_p  )  [static]

Validate a LIM other task object pointer.

Parameters:
object_p Pointer to other task object.
Returns:
MSG code.

References _LIM_Other::key, and LIM_OTHER_VALID_KEY.

Referenced by LIM_other_check_state(), LIM_other_delete(), LIM_other_fwd_stop(), LIM_other_get_state(), LIM_other_handle_bulk(), LIM_other_handle_complete(), and LIM_other_send_stop().

unsigned int LIM_other_check_state ( LIM_Other object_p,
LIM_Other_State  valid_1,
LIM_Other_State  valid_2 
)

Determine if another task is in a valid state.

Parameters:
object_p Pointer to other task object.
valid_1 First valid state.
valid_2 Second valid state.
Returns:
MSG code.

References _LIM_Other::desc, lim_other_check(), LIM_OTHER_STATE_IDLE, LIM_OTHER_STATE_RUNNING, LIM_OTHER_STATE_STOPPING, LIM_OTHER_STATE_UNKNOWN, and _LIM_Other::state.

Referenced by LIM_lpa_set_mode(), LIM_other_fwd_active(), LIM_other_fwd_idle(), and LIM_other_send_start().

unsigned int LIM_other_delete ( LIM_Other object_p  ) 

Shutdown and delete an other task object.

Parameters:
object_p Pointer to object.
Returns:
MSG code.

References _LIM_Other::desc, _LIM_Other::key, and lim_other_check().

Referenced by LIM_lci_delete(), LIM_lpa_delete(), and LIM_other_new().

unsigned int LIM_other_fwd_active ( LIM_Other object_p,
const ITC_QueueItem *  qitem_p,
LIM_Pkt_Send pkt_send_p,
LIM_Action_Id  action 
)

Forward an 'active' command to another task.

Parameters:
object_p Pointer to other task object.
qitem_p Pointer to queue item containing the command.
pkt_send_p Pointer to packet sending object for the command.
action Action to report.
Returns:
MSG code.

References _LIM_Other::action_p, LIM_action_report(), LIM_other_check_state(), LIM_OTHER_STATE_RUNNING, and LIM_pkt_fwd_pkt().

Referenced by LIM_lci_fwd_other(), LIM_lpa_fwd_active(), and LIM_lpa_fwd_gbm_cmd().

unsigned int LIM_other_fwd_idle ( LIM_Other object_p,
const ITC_QueueItem *  qitem_p,
LIM_Pkt_Send pkt_send_p,
LIM_Action_Id  action 
)

Forward an 'idle' command to another task.

Parameters:
object_p Pointer to other task object.
qitem_p Pointer to queue item containing the command.
pkt_send_p Pointer to packet sending object for the command.
action Action to report.
Returns:
MSG code.

References _LIM_Other::action_p, LIM_action_report(), LIM_other_check_state(), LIM_OTHER_STATE_IDLE, and LIM_pkt_fwd_pkt().

Referenced by LIM_lpa_fwd_idle().

unsigned int LIM_other_fwd_stop ( LIM_Other object_p,
const ITC_QueueItem *  qitem_p,
LIM_Pkt_Send pkt_send_p 
)

Forward a Stop command to another task.

Parameters:
object_p Pointer to other task object.
qitem_p Pointer to queue item containing the command.
pkt_send_p Pointer to packet sending object for the command.
Returns:
MSG code.

References _LIM_Other::action_p, _LIM_Other::action_stop, LIM_action_report(), lim_other_change_state(), lim_other_check(), LIM_OTHER_STATE_IDLE, LIM_OTHER_STATE_RUNNING, LIM_OTHER_STATE_STOPPING, LIM_OTHER_STATE_UNKNOWN, LIM_pkt_fwd_pkt(), and _LIM_Other::state.

Referenced by LIM_lci_fwd_abort(), and LIM_lpa_fwd_stop().

LIM_Other_State LIM_other_get_state ( LIM_Other object_p  ) 

Return the current state of another task.

Parameters:
object_p Pointer to other task object.
Returns:
Current state of the other task.

References lim_other_check(), LIM_OTHER_STATE_UNKNOWN, and _LIM_Other::state.

Referenced by LIM_lci_get_state(), LIM_lpa_gbm_int(), and LIM_lpa_get_state().

unsigned int LIM_other_handle_bulk ( LIM_Other object_p,
const ITC_QueueItem *  qitem_p 
)

unsigned int LIM_other_handle_complete ( LIM_Other object_p  ) 

Handle a Complete message from another task.

Parameters:
object_p Pointer to other task object.
Returns:
MSG code.

References lim_other_change_state(), lim_other_check(), and LIM_OTHER_STATE_IDLE.

Referenced by LIM_lci_handle_complete(), and LIM_lpa_handle_complete().

unsigned int LIM_other_new ( LIM_Other **  object_pp,
LIM_Task task_p,
LIM_Action action_p,
LIM_Pkt_Send pkt_start_p,
LIM_Pkt_Send pkt_stop_p,
LIM_Action_Id  action_change,
LIM_Action_Id  action_start,
LIM_Action_Id  action_start_status,
LIM_Action_Id  action_restart,
LIM_Action_Id  action_stop,
LIM_Action_Id  action_stop_status,
char *  desc 
)

Create and initialize a new other task object.

Parameters:
object_pp Location to return pointer to new object.
task_p Pointer to a task object.
action_p Pointer to an action reporting object.
pkt_start_p Pointer to Start cmd packet sending object.
pkt_stop_p Pointer to Stop cmd packet sending object.
action_change Action to report when changing object state.
action_start Action to report when sending Start cmd.
action_restart Action to report when sending Restart cmd.
action_stop Action to report when sending Stop cmd.
action_start_status Action to report when rcving Start status.
action_stop_status Action to report when rcving Stop status.
desc Description of the new object.
Returns:
MSG code.

References _LIM_Other::action_change, _LIM_Other::action_p, _LIM_Other::action_start, _LIM_Other::action_start_status, _LIM_Other::action_stop, _LIM_Other::action_stop_status, _LIM_Other::desc, _LIM_Other::key, LIM_other_delete(), LIM_OTHER_STATE_IDLE, LIM_OTHER_VALID_KEY, _LIM_Other::pkt_start_p, _LIM_Other::pkt_stop_p, _LIM_Other::state, and _LIM_Other::task_p.

Referenced by LIM_lci_new(), and LIM_lpa_new().

unsigned int LIM_other_send_start ( LIM_Other object_p,
const unsigned char *  pkt_p,
unsigned int  pkt_bytes 
)

Send a Start command to another task.

Parameters:
object_p Pointer to other task object.
pkt_p Pointer to command packet data.
pkt_bytes Size of command packet data, in bytes.
Returns:
MSG code.

References _LIM_Other::action_p, _LIM_Other::action_start, LIM_action_report(), lim_other_change_state(), LIM_other_check_state(), LIM_OTHER_STATE_IDLE, LIM_OTHER_STATE_RUNNING, LIM_pkt_send_cmd(), _LIM_Other::pkt_start_p, and _LIM_Other::start_qitem_p.

Referenced by LIM_lci_send_start(), and LIM_lpa_send_start().

unsigned int LIM_other_send_stop ( LIM_Other object_p,
const unsigned char *  pkt_p,
unsigned int  pkt_bytes 
)

Send a Stop command to another task.

Parameters:
object_p Pointer to other task object.
pkt_p Pointer to command packet data.
pkt_bytes Size of command packet data, in bytes.
Returns:
MSG code.

References _LIM_Other::action_p, _LIM_Other::action_stop, LIM_action_report(), lim_other_change_state(), lim_other_check(), LIM_OTHER_STATE_IDLE, LIM_OTHER_STATE_RUNNING, LIM_OTHER_STATE_STOPPING, LIM_OTHER_STATE_UNKNOWN, LIM_pkt_send_cmd(), _LIM_Other::pkt_stop_p, and _LIM_Other::state.

Referenced by LIM_lci_send_abort(), and LIM_lpa_send_stop().


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