GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> FILE / dev > file_lcp / rhel5-64


Interface   Data Structures   File List   Data Fields   Globals  

FILE_lcp_command.c File Reference

Routines associated with CCSDS commands to subsystem FILE. More...

#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <PBI/Endianness.h>
#include <PBS/WUT.h>
#include <PBS/SEM.h>
#include <MSG/MSG_pubdefs.h>
#include <ITC/ITC_pubdefs.h>
#include <ITC/ITC_msgs.h>
#include <CCSDS/CCSDS_pkt.h>
#include <FBS/FBS_pubrtos.h>
#include <FILE_DB/FILE_DB_schema.h>
#include <FILE/FILE_cmddefs.h>
#include <FILE/FILE_lcp_msg.h>
#include <FILE/FILE_upl.h>
#include <FILE/FILE_upl_cmd.h>
#include <FILE_lcp_private.h>

Functions

static void cmdFree (ITC_QueueItem *qitem, unsigned int status, FILE_Control *ctl, void *prm1, void *prm2)
unsigned int FILE_UploadStart (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Callback function for the LFILUPLSTART command.
unsigned int FILE_UploadCancel (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Callback function for the LFILUPLCANCEL command.
unsigned int FILE_UploadCommit (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Callback function for the LFILUPLCOMMIT command.
unsigned int FILE_UploadData (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Callback function for the LFILUPLDATA command.
unsigned int FILE_UploadEPU (void *prm, const struct _ITC_QueueItem *qitem, void *pay, unsigned int len)
 Callback function for the LFILUPLEPU command.
static WUT_cb_status FILE_uplDelay (SEM sem, WUT_tmr *timer)


Detailed Description

Routines associated with CCSDS commands to subsystem FILE.

Author:
D.L. Wood

Function Documentation

static void cmdFree ( ITC_QueueItem *  qitem,
unsigned int  status,
FILE_Control ctl,
void *  prm1,
void *  prm2 
) [static]

Free memory after sending ITC commands.

Parameters:
qitem The memory buffer.
status Status of command.
ctl FILE control structure.
prm1 Completion callback paramter 1.
prm2 Completion callback paramter 2.

References _FILE_Control::config, _FILE_Control::epu_upl_sem, _FILE_Control::epu_upl_timer, and FILE_uplDelay().

Referenced by FILE_UploadEPU().

WUT_cb_status FILE_uplDelay ( SEM  sem,
WUT_tmr *  timer 
) [static]

Timer callback for file upload send delay.

Parameters:
sem The semaphore to release to indicate delay done.
timer The WUT handle for the timer.
Returns:
WUT_K_STATE_CHANGE_NO.

Referenced by cmdFree().

unsigned int FILE_UploadCancel ( void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len 
)

Callback function for the LFILUPLCANCEL command.

Passes the file upload cancel telecommand to the file upload state machine.

Parameters:
prm User context parameter
qitem Queue item
pay Payload pointer
len Payload length
Returns:
A FILE MSG code.

References _FILE_NODEPAD::bf, _FILE_Control::cmd_hdr_size, FILE_uplPkt(), _FILE_UploadCancel_Prm::flag, _FILE_Control::node_id, _FILE_Control::upl, and _FILE_NODEPAD::us.

unsigned int FILE_UploadCommit ( void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len 
)

Callback function for the LFILUPLCOMMIT command.

After passing the file upload commit telecommand to the file upload state machine and verifying that the commit validation was successful, the requested file is created and the contents of the file upload buffer are written out.

Parameters:
prm User context parameter
qitem Queue item
pay Payload pointer
len Payload length
Returns:
A FILE MSG code.

References _FILE_NODEPAD::bf, _FILE_Upl_Info::buf_addr, _FILE_Control::cmd_hdr_size, FILE_UPL_STATE_COMMIT, FILE_uplInfo(), FILE_uplPkt(), FILE_uplReset(), FILE_uplSetError(), _FILE_UploadCommit_Prm::fileFlags, _FILE_UploadCommit_Prm::fileId, _FILE_UploadCommit_Prm::flag, _FILE_Upl_Info::id_commit, _FILE_Control::node_id, _FILE_Control::path_str, _FILE_Upl_Info::size_commit, _FILE_Upl_Info::state, _FILE_Control::upl, and _FILE_NODEPAD::us.

unsigned int FILE_UploadData ( void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len 
)

Callback function for the LFILUPLDATA command.

Passes the file upload data telecommand to the file upload state machine.

Parameters:
prm User context parameter
qitem Queue item
pay Payload pointer
len Payload length
Returns:
A FILE MSG code.

References _FILE_Control::cmd_hdr_size, FILE_uplPkt(), _FILE_UploadData_Prm::fileOffset, and _FILE_Control::upl.

unsigned int FILE_UploadEPU ( void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len 
)

unsigned int FILE_UploadStart ( void *  prm,
const struct _ITC_QueueItem qitem,
void *  pay,
unsigned int  len 
)

Callback function for the LFILUPLSTART command.

Passes the file upload start telecommand to the file upload state machine.

Parameters:
prm User context parameter
qitem Queue item
pay Payload pointer
len Payload length
Returns:
A FILE MSG code.

References _FILE_Control::cmd_hdr_size, FILE_uplPkt(), _FILE_UploadStart_Prm::fileSize, and _FILE_Control::upl.


Generated on Mon Mar 28 18:24:57 2011 by  doxygen 1.5.8