GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> MEM / V5-8-2 > mem_unit_test / mv2304


Interface   Data Structures   File List   Data Fields   Globals  

mem_util_cmd.c File Reference

Send and handle commands. More...

#include <string.h>
#include <CCSDS/CCSDS_pkt.h>
#include <CCSDS/CCSDS_swap.h>
#include <ITC/ITC_pubdefs.h>
#include <MEM/MEM_msgs.h>
#include <MSG/MSG_pubdefs.h>
#include <PBS/BSWP.h>
#include <PBS/MBA.h>
#include <PBS/TASK.h>
#include <mem_unit_test.h>
#include <mem_util_cmd.h>
#include <mem_util_pool.h>
#include <mem_util_task.h>
#include <mem_util_wrap.h>

Defines

#define CMD_APID_MEM_DUMP   (1604)
#define CMD_APID_MEM_LOAD   (1604)
#define CMD_FC_MEM_DUMP   ( 0)
#define CMD_FC_MEM_LOAD   ( 4)
#define CMD_FC_DUMP_NEXT   (100)

Functions

int CMD_init (test_Test_Descriptor *td_p)
 Initialize the command handler.
int CMD_start (test_Test_Descriptor *td_p)
 Start the command handler task.
int CMD_stop (test_Test_Descriptor *td_p)
 Stop the command handler task.
int CMD_shutdown (test_Test_Descriptor *td_p)
 Shutdown the command handler.
static int cmd_send (test_Test_Descriptor *td_p, int id, WRAP_Info *info_p, unsigned int num_parms, unsigned int *parm_bytes, unsigned int *parm_values, unsigned int apid, unsigned int func_code, unsigned int short_bytes)
 Send a command to a task.
int CMD_send_dump_mem (test_Test_Descriptor *td_p, int id, WRAP_Info *info_p, unsigned int lat_unit, unsigned int tran_id, unsigned int address, unsigned int num_words, unsigned int short_bytes)
 Send the Dump-Memory command.
int CMD_send_load_mem (test_Test_Descriptor *td_p, int id, WRAP_Info *info_p, unsigned int lat_unit, unsigned int tran_id, unsigned int address, unsigned int num_words, unsigned int data_start, unsigned int data_delta, unsigned int short_bytes)
 Send the Load-Memory command.


Detailed Description

Send and handle commands.

**  CVS $Id: mem_util_cmd.c,v 1.3 2011/03/29 01:58:52 apw Exp $
**  

Function Documentation

int CMD_init ( test_Test_Descriptor td_p  ) 

Initialize the command handler.

Parameters:
td_p Pointer to test descriptor.
Return values:
0 Success.
-1 Failure.

References _test_Test_Descriptor::cmd_task_p, TASK_init(), test_Pop_State(), and test_Push_State().

Referenced by mem_RamAccess_test().

int cmd_send ( test_Test_Descriptor td_p,
int  id,
WRAP_Info info_p,
unsigned int  num_parms,
unsigned int *  parm_bytes,
unsigned int *  parm_values,
unsigned int  apid,
unsigned int  func_code,
unsigned int  short_bytes 
) [static]

Send a command to a task.

Parameters:
td_p Pointer to test descriptor.
id ID to use for user messages.
info_p Pointer to wrap control info.
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.
short_bytes Number of bytes to remove from the command.
Return values:
0 Success.
-1 Failure.

References _WRAP_Info::act_cmd_sts_in, _WRAP_Info::exp_cmd_sts_in, _WRAP_Info::num_exp_telem, POOL_alloc(), test_Delay(), test_NULL_Compare(), test_Pop_State(), test_Push_State(), test_Show_Item(), test_Show_Msg_OK(), test_Status_Compare(), test_Status_Success(), WRAP_check_telem(), and WRAP_get_info().

Referenced by CMD_send_dump_mem(), and CMD_send_load_mem().

int CMD_send_dump_mem ( test_Test_Descriptor td_p,
int  id,
WRAP_Info info_p,
unsigned int  lat_unit,
unsigned int  tran_id,
unsigned int  address,
unsigned int  num_words,
unsigned int  short_bytes 
)

Send the Dump-Memory command.

Parameters:
td_p Pointer to test descriptor.
id ID to use for user messages.
info_p Pointer to wrap control info.
lat_unit LAT Unit parameter value.
tran_id Transaction ID parameter value.
address Address parameter value.
num_words Word Count parameter value.
short_bytes Number of bytes to remove from the command.
Return values:
0 Success.
-1 Failure.

References cmd_send(), DIM, _WRAP_Info::exp_cmd_sts_in, _WRAP_Info::exp_info, test_Pop_State(), and test_Push_State().

Referenced by mem_RamAccess_test().

int CMD_send_load_mem ( test_Test_Descriptor td_p,
int  id,
WRAP_Info info_p,
unsigned int  lat_unit,
unsigned int  tran_id,
unsigned int  address,
unsigned int  num_words,
unsigned int  data_start,
unsigned int  data_delta,
unsigned int  short_bytes 
)

Send the Load-Memory command.

Parameters:
td_p Pointer to test descriptor.
id ID to use for user messages.
info_p Pointer to wrap control info.
lat_unit LAT Unit parameter value.
tran_id Transaction ID parameter value.
address Address parameter value.
num_words Word Count parameter value.
data_start Value of first Data parameter.
data_delta Difference between adjacent Data parameter values.
short_bytes Number of bytes to remove from the command.
Return values:
0 Success.
-1 Failure.

References cmd_send(), DIM, _WRAP_Info::exp_cmd_sts_in, _WRAP_Info::exp_info, test_Pop_State(), and test_Push_State().

Referenced by mem_RamAccess_test().

int CMD_shutdown ( test_Test_Descriptor td_p  ) 

Shutdown the command handler.

Parameters:
td_p Pointer to test descriptor.
Return values:
0 Success.
-1 Failure.

References _test_Test_Descriptor::cmd_task_p, TASK_shutdown(), test_Pop_State(), and test_Push_State().

Referenced by mem_RamAccess_test().

int CMD_start ( test_Test_Descriptor td_p  ) 

Start the command handler task.

Parameters:
td_p Pointer to test descriptor.
Return values:
0 Success.
-1 Failure.

References _test_Test_Descriptor::cmd_task_p, TASK_start(), test_Pop_State(), and test_Push_State().

Referenced by mem_RamAccess_test().

int CMD_stop ( test_Test_Descriptor td_p  ) 

Stop the command handler task.

Parameters:
td_p Pointer to test descriptor.
Return values:
0 Success.
-1 Failure.

References _test_Test_Descriptor::cmd_task_p, TASK_stop(), test_Pop_State(), and test_Push_State().

Referenced by mem_RamAccess_test().


Generated on Wed Nov 21 21:09:16 2012 by  doxygen 1.5.8