\hypertarget{dump_8h}{
\section{dump.h File Reference}
\label{dump_8h}\index{dump.h@{dump.h}}
}
Framework used to parse the contents of a stream of datagrams.  


{\tt \#include $<$LSF/LSF\_\-scan.h$>$}\par
{\tt \#include $<$stdlib.h$>$}\par
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
\hypertarget{dump_8h_3800f2e1bb2428e599098c2c6bfcdc3f}{
typedef struct \hyperlink{struct__ApidStream}{\_\-ApidStream} \hyperlink{dump_8h_3800f2e1bb2428e599098c2c6bfcdc3f}{ApidStream}}
\label{dump_8h_3800f2e1bb2428e599098c2c6bfcdc3f}

\begin{CompactList}\small\item\em APID stream structure typedef. \item\end{CompactList}\item 
\hypertarget{dump_8h_8e926564ce86707cd6ce78d51ab3c47e}{
typedef LSF\_\-scanContributionHandler \hyperlink{dump_8h_8e926564ce86707cd6ce78d51ab3c47e}{DUMP\_\-dgmHandler} (\hyperlink{struct__ApidStream}{ApidStream} $\ast$stream, const LSF\_\-datagram $\ast$dgm)}
\label{dump_8h_8e926564ce86707cd6ce78d51ab3c47e}

\begin{CompactList}\small\item\em Application specific datagram handler. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
size\_\-t \hyperlink{dump_8h_191cc54b0c5babf23f68d766b971ee7c}{DUMP\_\-sizeofAstream} (void)
\begin{CompactList}\small\item\em Return the size of the ApidStream structure. \item\end{CompactList}\item 
\hyperlink{struct__ApidStream}{ApidStream} $\ast$ \hyperlink{dump_8h_4741b178757906fe4026e1f028d4c235}{DUMP\_\-constructAstream} (void $\ast$astream, unsigned int dgmid, unsigned short apid, unsigned char $\ast$dsc\_\-buf, size\_\-t buf\_\-size, \hyperlink{dump_8h_8e926564ce86707cd6ce78d51ab3c47e}{DUMP\_\-dgmHandler} $\ast$dgm\_\-handler, void $\ast$rsrc)
\begin{CompactList}\small\item\em Construct an ApidStream structure using the resources provided. \item\end{CompactList}\item 
void $\ast$ \hyperlink{dump_8h_366706fb6676121be6a14d48035d4c52}{DUMP\_\-getResource} (\hyperlink{struct__ApidStream}{ApidStream} $\ast$astream)
\begin{CompactList}\small\item\em Hand back the pointer to the application resources. \item\end{CompactList}\item 
void \hyperlink{dump_8h_ed40dc52f2383b34caa1f7641ca2b85f}{DUMP\_\-getTime} (\hyperlink{struct__ApidStream}{ApidStream} $\ast$astream, unsigned int $\ast$secs, unsigned int $\ast$usecs)
\begin{CompactList}\small\item\em Get the packet time for the current datagram. \item\end{CompactList}\item 
int \hyperlink{dump_8h_3433fa2a4c1dec1c990bb93350329292}{DUMP\_\-process} (const char $\ast$file, int dmp\_\-ccsds)
\begin{CompactList}\small\item\em Process a file of science datagrams. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Framework used to parse the contents of a stream of datagrams. 

\begin{Desc}
\item[Author:]James Swain \& Owen Saxton\end{Desc}
\begin{Desc}
\item[Id]\hyperlink{dump_8h}{dump.h},v 1.4 2011/03/28 19:01:45 saxton Exp \end{Desc}


\subsection{Function Documentation}
\hypertarget{dump_8h_4741b178757906fe4026e1f028d4c235}{
\index{dump.h@{dump.h}!DUMP\_\-constructAstream@{DUMP\_\-constructAstream}}
\index{DUMP\_\-constructAstream@{DUMP\_\-constructAstream}!dump.h@{dump.h}}
\subsubsection[{DUMP\_\-constructAstream}]{\setlength{\rightskip}{0pt plus 5cm}{\bf ApidStream}$\ast$ DUMP\_\-constructAstream (void $\ast$ {\em astream}, \/  unsigned int {\em dgmid}, \/  unsigned short {\em apid}, \/  unsigned char $\ast$ {\em dsc\_\-buf}, \/  size\_\-t {\em buf\_\-size}, \/  {\bf DUMP\_\-dgmHandler} $\ast$ {\em dgm\_\-handler}, \/  void $\ast$ {\em rsrc})}}
\label{dump_8h_4741b178757906fe4026e1f028d4c235}


Construct an ApidStream structure using the resources provided. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em astream}]Pointer to the ApidStream structure.\item[{\em dgmid}]The ID of the datagrams to process.\item[{\em apid}]The Apid of the packets to process.\item[{\em dsc\_\-buf}]The address of the buffer to contain each complete datagram.\item[{\em buf\_\-size}]The size, in bytes, of the datagram buffer.\item[{\em dgm\_\-handler}]The address of the routine to be called to process each complete datagram.\item[{\em rsrc}]Resource handle to be associated with the stream.\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer to the constructed ApidStream structure \end{Desc}


References \_\-ApidStream::dgm\_\-handler, \_\-ApidStream::dgmid, \_\-ApidStream::dsc, \_\-ApidStream::dsc\_\-buf, LL\_\-registerNode(), \_\-ApidStream::rsrc, \_\-ApidStream::secs, and \_\-ApidStream::usecs.\hypertarget{dump_8h_366706fb6676121be6a14d48035d4c52}{
\index{dump.h@{dump.h}!DUMP\_\-getResource@{DUMP\_\-getResource}}
\index{DUMP\_\-getResource@{DUMP\_\-getResource}!dump.h@{dump.h}}
\subsubsection[{DUMP\_\-getResource}]{\setlength{\rightskip}{0pt plus 5cm}void$\ast$ DUMP\_\-getResource ({\bf ApidStream} $\ast$ {\em astream})}}
\label{dump_8h_366706fb6676121be6a14d48035d4c52}


Hand back the pointer to the application resources. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em astream}]Pointer to the ApidStream structure\end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]Pointer handed to DUMP when DUMP\_\-constructAstream was invoked \end{Desc}


References \_\-ApidStream::rsrc.\hypertarget{dump_8h_ed40dc52f2383b34caa1f7641ca2b85f}{
\index{dump.h@{dump.h}!DUMP\_\-getTime@{DUMP\_\-getTime}}
\index{DUMP\_\-getTime@{DUMP\_\-getTime}!dump.h@{dump.h}}
\subsubsection[{DUMP\_\-getTime}]{\setlength{\rightskip}{0pt plus 5cm}void DUMP\_\-getTime ({\bf ApidStream} $\ast$ {\em astream}, \/  unsigned int $\ast$ {\em secs}, \/  unsigned int $\ast$ {\em usecs})}}
\label{dump_8h_ed40dc52f2383b34caa1f7641ca2b85f}


Get the packet time for the current datagram. 

This routine returns the time fields from the last telemetry packet of the current datagram.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em astream}]Pointer to the ApidStream structure.\item[{\em secs}]The address of an integer to receive the seconds value.\item[{\em usecs}]The address of an integer to receive the microseconds value. \end{description}
\end{Desc}


References \_\-ApidStream::secs, and \_\-ApidStream::usecs.\hypertarget{dump_8h_3433fa2a4c1dec1c990bb93350329292}{
\index{dump.h@{dump.h}!DUMP\_\-process@{DUMP\_\-process}}
\index{DUMP\_\-process@{DUMP\_\-process}!dump.h@{dump.h}}
\subsubsection[{DUMP\_\-process}]{\setlength{\rightskip}{0pt plus 5cm}int DUMP\_\-process (const char $\ast$ {\em file}, \/  int {\em dmp\_\-ccsds})}}
\label{dump_8h_3433fa2a4c1dec1c990bb93350329292}


Process a file of science datagrams. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em file}]Name of the file to process\item[{\em dmp\_\-ccsds}]Flag indicating whether (1) or not (0) to print out the raw CCSDS\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0}]Success \item[{\em $\sim$0}]Failure \end{description}
\end{Desc}


References \_\-ApidStream::dsc, LL\_\-getPayload(), \_\-ApidStream::secs, and \_\-ApidStream::usecs.\hypertarget{dump_8h_191cc54b0c5babf23f68d766b971ee7c}{
\index{dump.h@{dump.h}!DUMP\_\-sizeofAstream@{DUMP\_\-sizeofAstream}}
\index{DUMP\_\-sizeofAstream@{DUMP\_\-sizeofAstream}!dump.h@{dump.h}}
\subsubsection[{DUMP\_\-sizeofAstream}]{\setlength{\rightskip}{0pt plus 5cm}size\_\-t DUMP\_\-sizeofAstream (void)}}
\label{dump_8h_191cc54b0c5babf23f68d766b971ee7c}


Return the size of the ApidStream structure. 

\begin{Desc}
\item[Returns:]Size of the ApidStream structure \end{Desc}
