\hypertarget{siis2moc_8c}{
\section{siis2moc.c File Reference}
\label{siis2moc_8c}\index{siis2moc.c@{siis2moc.c}}
}
Convert a SIIS archive file to MOC level 0 files.  


{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include $<$time.h$>$}\par
{\tt \#include \char`\"{}CCSDS/CCSDS\_\-pkt.h\char`\"{}}\par
{\tt \#include \char`\"{}CCSDS/CCSDS\_\-pri.h\char`\"{}}\par
{\tt \#include \char`\"{}MSG/MSG\_\-pubdefs.h\char`\"{}}\par
{\tt \#include \char`\"{}MSG/MSG\_\-print\-Proc.h\char`\"{}}\par
{\tt \#include \char`\"{}PBS/TASK.h\char`\"{}}\par
{\tt \#include \char`\"{}SIIS/SIIS\_\-file.h\char`\"{}}\par
{\tt \#include \char`\"{}SIIS/SIIS\_\-moc.h\char`\"{}}\par
{\tt \#include \char`\"{}SIIS/SIIS\_\-rec.h\char`\"{}}\par
{\tt \#include \char`\"{}SIIS/SIIS\_\-vcdu.h\char`\"{}}\par


Include dependency graph for siis2moc.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=137pt]{siis2moc_8c__incl}
\end{center}
\end{figure}
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__Apid__Info}{\_\-Apid\_\-Info}
\end{CompactItemize}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define \hyperlink{siis2moc_8c_a0}{GLAST\_\-ID}\ 251
\item 
\#define \hyperlink{siis2moc_8c_a1}{DIM}(a)\ (sizeof (a) / sizeof ($\ast$a))
\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef \hyperlink{struct__Apid__Info}{\_\-Apid\_\-Info} \hyperlink{siis2moc_8c_a2}{Apid\_\-Info}
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
unsigned int \hyperlink{siis2moc_8c_a10}{find\_\-apid\_\-entry} (\hyperlink{struct__Apid__Info}{Apid\_\-Info} $\ast$$\ast$apid\_\-info\_\-p, const unsigned short apid, const unsigned short vcid)
\item 
unsigned int \hyperlink{siis2moc_8c_a11}{add\_\-apid\_\-entry} (\hyperlink{struct__Apid__Info}{Apid\_\-Info} $\ast$$\ast$apid\_\-info\_\-p, const unsigned short apid, const unsigned short vcid)
\item 
unsigned int \hyperlink{siis2moc_8c_a12}{parse\_\-command\_\-line} (int argc, char $\ast$argv\mbox{[}$\,$\mbox{]})
\begin{CompactList}\small\item\em Interpret the command line parameters. \item\end{CompactList}\item 
void \hyperlink{siis2moc_8c_a13}{print\_\-message} (MSG\_\-Output\-Modes mode, void $\ast$prm, const MSG\_\-Message $\ast$msg)
\begin{CompactList}\small\item\em Output processor callback routine to print messages. \item\end{CompactList}\item 
unsigned int \hyperlink{siis2moc_8c_a14}{start\_\-message\_\-system} (void)
\item 
unsigned int \hyperlink{siis2moc_8c_a15}{stop\_\-message\_\-system} (void)
\item 
unsigned int \hyperlink{siis2moc_8c_a16}{skip\_\-file\_\-data} (FILE $\ast$in\_\-file, const unsigned int num\_\-bytes)
\item 
unsigned int \hyperlink{siis2moc_8c_a17}{create\_\-moc\_\-file} (\hyperlink{struct__Apid__Info}{Apid\_\-Info} $\ast$apid\_\-info, const \hyperlink{struct__SIIS__Pdu__Hdr}{SIIS\_\-Pdu\_\-Hdr} $\ast$pdu\_\-hdr)
\item 
unsigned int \hyperlink{siis2moc_8c_a18}{get\_\-apid\_\-info} (\hyperlink{struct__Apid__Info}{Apid\_\-Info} $\ast$$\ast$apid\_\-info\_\-p, const \hyperlink{struct__SIIS__Pdu__Hdr}{SIIS\_\-Pdu\_\-Hdr} $\ast$pdu\_\-hdr, const unsigned short apid)
\item 
unsigned int \hyperlink{siis2moc_8c_a19}{close\_\-moc\_\-files} (void)
\item 
unsigned int \hyperlink{siis2moc_8c_a20}{gather\_\-pdu\_\-header} (\hyperlink{struct__SIIS__Pdu__Hdr}{SIIS\_\-Pdu\_\-Hdr} $\ast$pdu\_\-hdr, const unsigned int vcdu\_\-status, const unsigned int time\_\-tag, const \hyperlink{struct__SIIS__Vcdu__Hdr}{SIIS\_\-Vcdu\_\-Hdr} $\ast$vcdu\_\-hdr)
\item 
unsigned int \hyperlink{siis2moc_8c_a21}{parse\_\-ccsds\_\-header} (const unsigned char $\ast$data, const unsigned int data\_\-bytes, unsigned short $\ast$type, unsigned short $\ast$apid, unsigned short $\ast$length)
\item 
unsigned int \hyperlink{siis2moc_8c_a22}{write\_\-ccsds\_\-packet} (\hyperlink{struct__SIIS__Pdu__Hdr}{SIIS\_\-Pdu\_\-Hdr} $\ast$pdu\_\-hdr, const unsigned char $\ast$data, const unsigned int data\_\-bytes, const unsigned short apid, const unsigned short length)
\item 
unsigned int \hyperlink{siis2moc_8c_a23}{extract\_\-ccsds\_\-packets} (\hyperlink{struct__SIIS__Pdu__Hdr}{SIIS\_\-Pdu\_\-Hdr} $\ast$pdu\_\-hdr, const unsigned char $\ast$data, unsigned int data\_\-bytes)
\item 
unsigned int \hyperlink{siis2moc_8c_a24}{process\_\-raw\_\-telem} (const unsigned char $\ast$body, const unsigned int body\_\-bytes, const unsigned int time\_\-tag)
\item 
unsigned int \hyperlink{siis2moc_8c_a25}{process\_\-record} (FILE $\ast$in\_\-file)
\item 
int \hyperlink{siis2moc_8c_a26}{main} (int argc, char $\ast$argv\mbox{[}$\,$\mbox{]})
\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
\hypertarget{siis2moc_8c_a3}{
char $\ast$ \hyperlink{siis2moc_8c_a3}{In\_\-File\_\-Name}}
\label{siis2moc_8c_a3}

\begin{CompactList}\small\item\em Pointer to the name of the input file. \item\end{CompactList}\item 
\hypertarget{siis2moc_8c_a4}{
int \hyperlink{siis2moc_8c_a4}{Include\_\-All}}
\label{siis2moc_8c_a4}

\begin{CompactList}\small\item\em Indicates whether we're including all APIDs. \item\end{CompactList}\item 
\hypertarget{siis2moc_8c_a5}{
int \hyperlink{siis2moc_8c_a5}{Frame\_\-Count} = 0}
\label{siis2moc_8c_a5}

\begin{CompactList}\small\item\em Number of VCDU frames processed. \item\end{CompactList}\item 
\hypertarget{siis2moc_8c_a6}{
int \hyperlink{siis2moc_8c_a6}{Packet\_\-Read\_\-Count} = 0}
\label{siis2moc_8c_a6}

\begin{CompactList}\small\item\em Number of CCSDS packets read. \item\end{CompactList}\item 
\hypertarget{siis2moc_8c_a7}{
int \hyperlink{siis2moc_8c_a7}{Packet\_\-Write\_\-Count} = 0}
\label{siis2moc_8c_a7}

\begin{CompactList}\small\item\em Number of CCSDS packets written. \item\end{CompactList}\item 
\hypertarget{siis2moc_8c_a8}{
int \hyperlink{siis2moc_8c_a8}{Apid\_\-Count} = 0}
\label{siis2moc_8c_a8}

\begin{CompactList}\small\item\em Number of different APIDs found. \item\end{CompactList}\item 
\hypertarget{siis2moc_8c_a9}{
\hyperlink{struct__Apid__Info}{Apid\_\-Info} \hyperlink{siis2moc_8c_a9}{Apid\_\-Vcid} \mbox{[}32\mbox{]} = \{ \{ 0 \} \}}
\label{siis2moc_8c_a9}

\begin{CompactList}\small\item\em Table of APID/VCIDs found in the archive file. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Convert a SIIS archive file to MOC level 0 files. 



\footnotesize\begin{verbatim}
  CVS $Id: siis2moc.c,v 1.3 2004/12/02 17:52:51 dmay Exp $
  \end{verbatim}\normalsize


Extract CCSDS packets from a SIIS archive file and write them to level 0 MOC files.

\subsection{Define Documentation}
\hypertarget{siis2moc_8c_a1}{
\index{siis2moc.c@{siis2moc.c}!DIM@{DIM}}
\index{DIM@{DIM}!siis2moc.c@{siis2moc.c}}
\subsubsection[DIM]{\setlength{\rightskip}{0pt plus 5cm}\#define DIM(a)\ (sizeof (a) / sizeof ($\ast$a))}}
\label{siis2moc_8c_a1}


Calculate the number of items in an array. \hypertarget{siis2moc_8c_a0}{
\index{siis2moc.c@{siis2moc.c}!GLAST_ID@{GLAST\_\-ID}}
\index{GLAST_ID@{GLAST\_\-ID}!siis2moc.c@{siis2moc.c}}
\subsubsection[GLAST\_\-ID]{\setlength{\rightskip}{0pt plus 5cm}\#define GLAST\_\-ID\ 251}}
\label{siis2moc_8c_a0}


Spacecraft ID for GLAST 

\subsection{Typedef Documentation}
\hypertarget{siis2moc_8c_a2}{
\index{siis2moc.c@{siis2moc.c}!Apid_Info@{Apid\_\-Info}}
\index{Apid_Info@{Apid\_\-Info}!siis2moc.c@{siis2moc.c}}
\subsubsection[Apid\_\-Info]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{struct__Apid__Info}{Apid\_\-Info}}}
\label{siis2moc_8c_a2}


The typedef for \hyperlink{struct__Apid__Info}{\_\-Apid\_\-Info} 

\subsection{Function Documentation}
\hypertarget{siis2moc_8c_a11}{
\index{siis2moc.c@{siis2moc.c}!add_apid_entry@{add\_\-apid\_\-entry}}
\index{add_apid_entry@{add\_\-apid\_\-entry}!siis2moc.c@{siis2moc.c}}
\subsubsection[add\_\-apid\_\-entry]{\setlength{\rightskip}{0pt plus 5cm}unsigned int add\_\-apid\_\-entry (\hyperlink{struct__Apid__Info}{Apid\_\-Info} $\ast$$\ast$ {\em apid\_\-info\_\-p}, const unsigned short {\em apid}, const unsigned short {\em vcid})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{siis2moc_8c_a11}


Add a new entry in the APID/VCID table for a particular APID and VCID.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em apid\_\-info\_\-p}]Pointer to location to store entry pointer. \item[{\em apid}]APID for the packet. \item[{\em vcid}]VCID for the packet.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A SIIS MSG value. \end{Desc}
\hypertarget{siis2moc_8c_a19}{
\index{siis2moc.c@{siis2moc.c}!close_moc_files@{close\_\-moc\_\-files}}
\index{close_moc_files@{close\_\-moc\_\-files}!siis2moc.c@{siis2moc.c}}
\subsubsection[close\_\-moc\_\-files]{\setlength{\rightskip}{0pt plus 5cm}unsigned int close\_\-moc\_\-files (void)\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{siis2moc_8c_a19}


Close all level 0 MOC files that have been created.

\begin{Desc}
\item[Returns:]A SIIS MSG value. \end{Desc}
\hypertarget{siis2moc_8c_a17}{
\index{siis2moc.c@{siis2moc.c}!create_moc_file@{create\_\-moc\_\-file}}
\index{create_moc_file@{create\_\-moc\_\-file}!siis2moc.c@{siis2moc.c}}
\subsubsection[create\_\-moc\_\-file]{\setlength{\rightskip}{0pt plus 5cm}unsigned int create\_\-moc\_\-file (\hyperlink{struct__Apid__Info}{Apid\_\-Info} $\ast$ {\em apid\_\-info}, const \hyperlink{struct__SIIS__Pdu__Hdr}{SIIS\_\-Pdu\_\-Hdr} $\ast$ {\em pdu\_\-hdr})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{siis2moc_8c_a17}


Create a level 0 MOC file for a CCSDS packet.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em apid\_\-info}]Pointer to APID/VCID table entry. \item[{\em pdu\_\-hdr}]Pointer to packet annotation header information.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A SIIS MSG value. \end{Desc}
\hypertarget{siis2moc_8c_a23}{
\index{siis2moc.c@{siis2moc.c}!extract_ccsds_packets@{extract\_\-ccsds\_\-packets}}
\index{extract_ccsds_packets@{extract\_\-ccsds\_\-packets}!siis2moc.c@{siis2moc.c}}
\subsubsection[extract\_\-ccsds\_\-packets]{\setlength{\rightskip}{0pt plus 5cm}unsigned int extract\_\-ccsds\_\-packets (\hyperlink{struct__SIIS__Pdu__Hdr}{SIIS\_\-Pdu\_\-Hdr} $\ast$ {\em pdu\_\-hdr}, const unsigned char $\ast$ {\em data}, unsigned int {\em data\_\-bytes})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{siis2moc_8c_a23}


Extract the CCSDS packets from within a VCDU frame and store them in MOC level 0 files.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pdu\_\-hdr}]Pointer to packet annotation header info. \item[{\em data}]Pointer to start of the VCDU frame data unit zone. \item[{\em data\_\-bytes}]Number of bytes of data within the data unit zone.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A SIIS MSG value. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=293pt]{siis2moc_8c_a23_cgraph}
\end{center}
\end{figure}
\hypertarget{siis2moc_8c_a10}{
\index{siis2moc.c@{siis2moc.c}!find_apid_entry@{find\_\-apid\_\-entry}}
\index{find_apid_entry@{find\_\-apid\_\-entry}!siis2moc.c@{siis2moc.c}}
\subsubsection[find\_\-apid\_\-entry]{\setlength{\rightskip}{0pt plus 5cm}unsigned int find\_\-apid\_\-entry (\hyperlink{struct__Apid__Info}{Apid\_\-Info} $\ast$$\ast$ {\em apid\_\-info\_\-p}, const unsigned short {\em apid}, const unsigned short {\em vcid})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{siis2moc_8c_a10}


Find an entry in the APID/VCID table for a particular APID and VCID.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em apid\_\-info\_\-p}]Pointer to location to store entry pointer. \item[{\em apid}]APID for the packet. \item[{\em vcid}]VCID for the packet.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A SIIS MSG value. \end{Desc}
\hypertarget{siis2moc_8c_a20}{
\index{siis2moc.c@{siis2moc.c}!gather_pdu_header@{gather\_\-pdu\_\-header}}
\index{gather_pdu_header@{gather\_\-pdu\_\-header}!siis2moc.c@{siis2moc.c}}
\subsubsection[gather\_\-pdu\_\-header]{\setlength{\rightskip}{0pt plus 5cm}unsigned int gather\_\-pdu\_\-header (\hyperlink{struct__SIIS__Pdu__Hdr}{SIIS\_\-Pdu\_\-Hdr} $\ast$ {\em pdu\_\-hdr}, const unsigned int {\em vcdu\_\-status}, const unsigned int {\em time\_\-tag}, const \hyperlink{struct__SIIS__Vcdu__Hdr}{SIIS\_\-Vcdu\_\-Hdr} $\ast$ {\em vcdu\_\-hdr})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{siis2moc_8c_a20}


Gather information that will be stored in a packet annotation header.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pdu\_\-hdr}]Pointer to location to store annotation header info. \item[{\em vcdu\_\-status}]Status from SIIS\_\-vcdu\-Get\-Hdr. \item[{\em time\_\-tag}]Time at which record was written to archive file. \item[{\em vcdu\_\-hdr}]Pointer to VCDU header info for this frame.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A SIIS MSG value. \end{Desc}
\hypertarget{siis2moc_8c_a18}{
\index{siis2moc.c@{siis2moc.c}!get_apid_info@{get\_\-apid\_\-info}}
\index{get_apid_info@{get\_\-apid\_\-info}!siis2moc.c@{siis2moc.c}}
\subsubsection[get\_\-apid\_\-info]{\setlength{\rightskip}{0pt plus 5cm}unsigned int get\_\-apid\_\-info (\hyperlink{struct__Apid__Info}{Apid\_\-Info} $\ast$$\ast$ {\em apid\_\-info\_\-p}, const \hyperlink{struct__SIIS__Pdu__Hdr}{SIIS\_\-Pdu\_\-Hdr} $\ast$ {\em pdu\_\-hdr}, const unsigned short {\em apid})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{siis2moc_8c_a18}


Find the entry in the APID/VCID table for a particular APID and VCID. If there is no entry, then create a new entry and a new level 0 MOC file.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em apid\_\-info\_\-p}]Pointer to location to store entry pointer. \item[{\em pdu\_\-hdr}]Pointer to packet annotation header information. \item[{\em apid}]APID for the packet.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A SIIS MSG value. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=130pt]{siis2moc_8c_a18_cgraph}
\end{center}
\end{figure}
\hypertarget{siis2moc_8c_a26}{
\index{siis2moc.c@{siis2moc.c}!main@{main}}
\index{main@{main}!siis2moc.c@{siis2moc.c}}
\subsubsection[main]{\setlength{\rightskip}{0pt plus 5cm}int main (int {\em argc}, char $\ast$ {\em argv}\mbox{[}$\,$\mbox{]})}}
\label{siis2moc_8c_a26}


The application entry point.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em argc}]The number of command line args. \item[{\em argv}]The list of command line args.\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0}]Success. \item[{\em -1}]Failure. \end{description}
\end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=345pt]{siis2moc_8c_a26_cgraph}
\end{center}
\end{figure}
\hypertarget{siis2moc_8c_a21}{
\index{siis2moc.c@{siis2moc.c}!parse_ccsds_header@{parse\_\-ccsds\_\-header}}
\index{parse_ccsds_header@{parse\_\-ccsds\_\-header}!siis2moc.c@{siis2moc.c}}
\subsubsection[parse\_\-ccsds\_\-header]{\setlength{\rightskip}{0pt plus 5cm}unsigned int parse\_\-ccsds\_\-header (const unsigned char $\ast$ {\em data}, const unsigned int {\em data\_\-bytes}, unsigned short $\ast$ {\em type}, unsigned short $\ast$ {\em apid}, unsigned short $\ast$ {\em length})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{siis2moc_8c_a21}


Extract information from the header of a CCSDS packet. Note that the 'length' value includes the length of the packet header.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em data}]Pointer to start of the packet buffer. \item[{\em data\_\-bytes}]Number of bytes of data in the packet buffer. \item[{\em type}]Pointer to location to return packet type. \item[{\em apid}]Pointer to location to return packet APID. \item[{\em length}]Pointer to location to return packet length.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A SIIS MSG value. \end{Desc}
\hypertarget{siis2moc_8c_a12}{
\index{siis2moc.c@{siis2moc.c}!parse_command_line@{parse\_\-command\_\-line}}
\index{parse_command_line@{parse\_\-command\_\-line}!siis2moc.c@{siis2moc.c}}
\subsubsection[parse\_\-command\_\-line]{\setlength{\rightskip}{0pt plus 5cm}unsigned int parse\_\-command\_\-line (int {\em argc}, char $\ast$ {\em argv}\mbox{[}$\,$\mbox{]})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{siis2moc_8c_a12}


Interpret the command line parameters. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em argc}]The number of command line args. \item[{\em argv}]The list of command line args.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A SIIS MSG value. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=149pt]{siis2moc_8c_a12_cgraph}
\end{center}
\end{figure}
\hypertarget{siis2moc_8c_a13}{
\index{siis2moc.c@{siis2moc.c}!print_message@{print\_\-message}}
\index{print_message@{print\_\-message}!siis2moc.c@{siis2moc.c}}
\subsubsection[print\_\-message]{\setlength{\rightskip}{0pt plus 5cm}void print\_\-message (MSG\_\-Output\-Modes {\em mode}, void $\ast$ {\em prm}, const MSG\_\-Message $\ast$ {\em msg})}}
\label{siis2moc_8c_a13}


Output processor callback routine to print messages. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em mode}](in) Output processor calling mode \item[{\em prm}](in) User parameter \item[{\em msg}](in) Message structure\end{description}
\end{Desc}
Prints a message using {\tt printf}. \hypertarget{siis2moc_8c_a24}{
\index{siis2moc.c@{siis2moc.c}!process_raw_telem@{process\_\-raw\_\-telem}}
\index{process_raw_telem@{process\_\-raw\_\-telem}!siis2moc.c@{siis2moc.c}}
\subsubsection[process\_\-raw\_\-telem]{\setlength{\rightskip}{0pt plus 5cm}unsigned int process\_\-raw\_\-telem (const unsigned char $\ast$ {\em body}, const unsigned int {\em body\_\-bytes}, const unsigned int {\em time\_\-tag})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{siis2moc_8c_a24}


Process a raw telemetry record from the SIIS archive file. For each CCSDS packet within the record, add a packet annotation header to it and store it into a level 0 MOC file.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em body}]Pointer to body of the record. \item[{\em body\_\-bytes}]Number of bytes of data within the record body. \item[{\em time\_\-tag}]Time at which record was written to archive file.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A SIIS MSG value. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=367pt]{siis2moc_8c_a24_cgraph}
\end{center}
\end{figure}
\hypertarget{siis2moc_8c_a25}{
\index{siis2moc.c@{siis2moc.c}!process_record@{process\_\-record}}
\index{process_record@{process\_\-record}!siis2moc.c@{siis2moc.c}}
\subsubsection[process\_\-record]{\setlength{\rightskip}{0pt plus 5cm}unsigned int process\_\-record (FILE $\ast$ {\em in\_\-file})}}
\label{siis2moc_8c_a25}


Process a record from the SIIS archive file. Do nothing with the record unless it is a raw telemetry record. For raw telemetry records, extract the CCSDS packets and store them in MOC level 0 files.

When finished, the file position indicator for in\_\-file will point to the start of the next record within the archive file.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em in\_\-file}]Archive file handle.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A SIIS MSG value. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=363pt]{siis2moc_8c_a25_cgraph}
\end{center}
\end{figure}
\hypertarget{siis2moc_8c_a16}{
\index{siis2moc.c@{siis2moc.c}!skip_file_data@{skip\_\-file\_\-data}}
\index{skip_file_data@{skip\_\-file\_\-data}!siis2moc.c@{siis2moc.c}}
\subsubsection[skip\_\-file\_\-data]{\setlength{\rightskip}{0pt plus 5cm}unsigned int skip\_\-file\_\-data (FILE $\ast$ {\em in\_\-file}, const unsigned int {\em num\_\-bytes})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{siis2moc_8c_a16}


Read and discard data from a file.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em in\_\-file}]File handle. \item[{\em num\_\-bytes}]Number of bytes to read and discard.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A SIIS MSG value. \end{Desc}
\hypertarget{siis2moc_8c_a14}{
\index{siis2moc.c@{siis2moc.c}!start_message_system@{start\_\-message\_\-system}}
\index{start_message_system@{start\_\-message\_\-system}!siis2moc.c@{siis2moc.c}}
\subsubsection[start\_\-message\_\-system]{\setlength{\rightskip}{0pt plus 5cm}unsigned int start\_\-message\_\-system (void)\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{siis2moc_8c_a14}


Start the messaging system.

\begin{Desc}
\item[Returns:]A SIIS MSG value. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=145pt]{siis2moc_8c_a14_cgraph}
\end{center}
\end{figure}
\hypertarget{siis2moc_8c_a15}{
\index{siis2moc.c@{siis2moc.c}!stop_message_system@{stop\_\-message\_\-system}}
\index{stop_message_system@{stop\_\-message\_\-system}!siis2moc.c@{siis2moc.c}}
\subsubsection[stop\_\-message\_\-system]{\setlength{\rightskip}{0pt plus 5cm}unsigned int stop\_\-message\_\-system (void)\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{siis2moc_8c_a15}


Stop the messaging system.

\begin{Desc}
\item[Returns:]A SIIS MSG value. \end{Desc}
\hypertarget{siis2moc_8c_a22}{
\index{siis2moc.c@{siis2moc.c}!write_ccsds_packet@{write\_\-ccsds\_\-packet}}
\index{write_ccsds_packet@{write\_\-ccsds\_\-packet}!siis2moc.c@{siis2moc.c}}
\subsubsection[write\_\-ccsds\_\-packet]{\setlength{\rightskip}{0pt plus 5cm}unsigned int write\_\-ccsds\_\-packet (\hyperlink{struct__SIIS__Pdu__Hdr}{SIIS\_\-Pdu\_\-Hdr} $\ast$ {\em pdu\_\-hdr}, const unsigned char $\ast$ {\em data}, const unsigned int {\em data\_\-bytes}, const unsigned short {\em apid}, const unsigned short {\em length})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{siis2moc_8c_a22}


Write a CCSDS packet and packet annotation header to a level 0 MOC file. There is a separate file for each APID/VCID. The file is created if this is the first packet for a given file.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pdu\_\-hdr}]Pointer to packet annotation header information. \item[{\em data}]Pointer to start of the packet buffer. \item[{\em data\_\-bytes}]Number of bytes of data in the packet buffer. \item[{\em apid}]APID for the packet. \item[{\em length}]Length of the packet, in bytes, as reported in its header.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]A SIIS MSG value. \end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=215pt]{siis2moc_8c_a22_cgraph}
\end{center}
\end{figure}
