GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> FILE / V3-11-1 > file_lcp / rhel5-64
#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) |
static void cmdFree | ( | ITC_QueueItem * | qitem, | |
unsigned int | status, | |||
FILE_Control * | ctl, | |||
void * | prm1, | |||
void * | prm2 | |||
) | [static] |
Free memory after sending ITC commands.
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.
sem | The semaphore to release to indicate delay done. | |
timer | The WUT handle for the timer. |
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.
prm | User context parameter | |
qitem | Queue item | |
pay | Payload pointer | |
len | Payload length |
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.
prm | User context parameter | |
qitem | Queue item | |
pay | Payload pointer | |
len | Payload length |
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.
prm | User context parameter | |
qitem | Queue item | |
pay | Payload pointer | |
len | Payload length |
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 | |||
) |
Callback function for the LFILUPLEPU command.
prm | User context parameter | |
qitem | Queue item | |
pay | Payload pointer | |
len | Payload length |
References _FILE_NODEPAD::bf, _FILE_Control::cmd_chksum_size, _FILE_Control::cmd_hdr_size, cmdFree(), _FILE_Control::config, _FILE_Control::epu_upl_buf, _FILE_Control::epu_upl_sem, FILE_APID_LAT_FILE_LOAD, FILE_UPLOADDATA_FCODE, FILE_UPLOADSTART_FCODE, _FILE_UploadData_Prm::fileData, _FILE_UploadEPU_Prm::fileId, _FILE_UploadData_Prm::fileOffset, _FILE_UploadStart_Prm::fileSize, _FILE_UploadEPU_Prm::flag, _FILE_Control::path_str, and _FILE_NODEPAD::us.
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.
prm | User context parameter | |
qitem | Queue item | |
pay | Payload pointer | |
len | Payload length |
References _FILE_Control::cmd_hdr_size, FILE_uplPkt(), _FILE_UploadStart_Prm::fileSize, and _FILE_Control::upl.