GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> FILE / dev > file_scp / mv2304


Interface   Data Structures   File List   Data Fields   Globals  

FILE_scp_command.c File Reference

SCP side of FILE commanding. More...

#include <stdio.h>
#include <errno.h>
#include <sys/stat.h>
#include <PBI/Endianness.h>
#include <PBS/TOV.h>
#include <PBS/WUT.h>
#include <PBS/SEM.h>
#include <PBS/MBA.h>
#include <MSG/MSG_pubdefs.h>
#include <CCSDS/CCSDS_pkt.h>
#include <ITC/ITC_dump.h>
#include <ITC/ITC_pubdefs.h>
#include <FBS/FBS_pubrtos.h>
#include <FILE/FILE_scp.h>
#include <FILE/FILE_cmddefs.h>
#include <FILE/FILE_upl_cmd.h>
#include <FILE/FILE_scp_msg.h>
#include <FILE/FILE_dump.h>

Defines

#define FILE_UPL_DATA_SIZE   48
#define FILE_UPL_DELAY   50000

Functions

static WUT_cb_status FILE_uplDelay (SEM sem, WUT_tmr *timer)
static void cmdFree (ITC_QueueItem *qitem, unsigned int status, void *prm0, void *prm1, void *prm2)
unsigned int FILE_sendUpl (const char *name, unsigned int dev, unsigned int dir, unsigned int file)
 Send a complete file upload telecommand set to the SIU.
unsigned int FILE_sendData (const char *name)
 Send a string of file upload data telecommands.
unsigned int FILE_sendCommit (unsigned int latUnit, unsigned int dev, unsigned int dir, unsigned int file)
 Send a file upload commit telecommand.
unsigned int FILE_sendCopyEpu (unsigned int latUnit, unsigned int dev, unsigned int dir, unsigned int file)
 Upload a copy of an SIU file to an EPU.
unsigned int FILE_sendCancel (unsigned int latUnit)
 Send a file upload cancel telecommand.


Detailed Description

SCP side of FILE commanding.

Author:
D.L.Wood

Define Documentation

#define FILE_UPL_DATA_SIZE   48

The size in bytes which one upl data packet can hold.

Referenced by FILE_sendData().

#define FILE_UPL_DELAY   50000

The delay time in microseconds between sening file upload telecommands.

Referenced by FILE_sendData().


Function Documentation

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

Free memory after sending ITC commands.

Parameters:
qitem The memory buffer.
status Status of command.
prm0 Completion callback paramter 0.
prm1 Completion callback paramter 1.
prm2 Completion callback paramter 2.

Referenced by FILE_sendCancel(), FILE_sendCommit(), FILE_sendCopyEpu(), and FILE_sendData().

unsigned int FILE_sendCancel ( unsigned int  latUnit  ) 

Send a file upload cancel telecommand.

Send the file upload cancel telecommand (LFILUPLCANCEL).

Parameters:
latUnit The LAT CPU to work on.
Returns:
A FILE MSG code.

References cmdFree(), FILE_APID_LAT_FILE_LOAD, and FILE_dumpUplCancel().

Referenced by FILE_sendCancelCli().

unsigned int FILE_sendCommit ( unsigned int  latUnit,
unsigned int  dev,
unsigned int  dir,
unsigned int  file 
)

Send a file upload commit telecommand.

Send the file upload cancel telecommand (LFILUPLCOMMIT).

Parameters:
latUnit The LAT CPU to work on.
dev Device number.
dir Directory number.
file File number.
Returns:
A FILE MSG code.

References cmdFree(), FILE_APID_LAT_FILE_LOAD, and FILE_dumpUplCommit().

Referenced by FILE_sendCommitCli(), and FILE_sendUpl().

unsigned int FILE_sendCopyEpu ( unsigned int  latUnit,
unsigned int  dev,
unsigned int  dir,
unsigned int  file 
)

Upload a copy of an SIU file to an EPU.

Send the file upload EPU telecommand (LFILUPLEPU), which copies a file from the SIU to an EPU

Parameters:
latUnit The LAT EPU CPU to send the file.
dev Device number for source file.
dir Directory number for source file.
file File number for source file.
Returns:
A FILE MSG code.

References cmdFree(), FILE_APID_LAT_FILE_LOAD, and FILE_dumpUplEpu().

Referenced by FILE_sendCopyEpuCli().

unsigned int FILE_sendData ( const char *  name  ) 

Send a string of file upload data telecommands.

A file is broken into a series of file upload data telecommands (LFILUPLDATA). This function automatically sends the file upload start telecommand (LFILUPLSTART) at the beginning.

Parameters:
name Path name of file to upload
Returns:
A FILE MSG code.

References cmdFree(), FILE_APID_LAT_FILE_LOAD, FILE_dumpUplData(), FILE_dumpUplStart(), FILE_UPL_DATA_SIZE, FILE_UPL_DELAY, and FILE_uplDelay().

Referenced by FILE_sendDataCli(), and FILE_sendUpl().

unsigned int FILE_sendUpl ( const char *  name,
unsigned int  dev,
unsigned int  dir,
unsigned int  file 
)

Send a complete file upload telecommand set to the SIU.

A file is broken into a series of file upload data telecommands (LFILUPLDATA). This function automatically sends the file upload start telecommand (LFILUPLSTART) at the beginning and the file upload commit telecommand (LFILUPLCOMMIT) at the end. Since this telecommand sequence is intended for use only for file uploads between the SC and SIU nodes, the LAT unit ID in the upload commit telecommand is set to 'SIU'.

Parameters:
name Path name of file to upload
dev Device number.
dir Directory number.
file File number.
Returns:
A FILE MSG code.

References FILE_sendCommit(), and FILE_sendData().

Referenced by FILE_sendUplCli().

static 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 FILE_sendData().


Generated on Mon Mar 28 18:27:51 2011 by  doxygen 1.5.8