\hypertarget{LSEPW_8h}{
\section{LSEPW.h File Reference}
\label{LSEPW_8h}\index{LSEPW.h@{LSEPW.h}}
}
Interface to the physics context specific information structures and routines. 

{\tt \#include \char`\"{}LSF/LSF\_\-cpu.h\char`\"{}}\par
{\tt \#include \char`\"{}LSF/LSF\_\-mode.h\char`\"{}}\par
{\tt \#include \char`\"{}LSF/LSF\_\-origin.h\char`\"{}}\par
{\tt \#include \char`\"{}LSF/LSF\_\-reason.h\char`\"{}}\par
{\tt \#include \char`\"{}LSE/LSEW\_\-dgm\-Fw.h\char`\"{}}\par


Include dependency graph for LSEPW.h:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=134pt]{LSEPW_8h__incl}
\end{center}
\end{figure}


This graph shows which files directly or indirectly include this file:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=101pt]{LSEPW_8h__dep__incl}
\end{center}
\end{figure}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{LSEPW_8h_a0}{LSEPW\_\-sizeof} (int level)
\begin{CompactList}\small\item\em Return the size of the LSEP data structure. \item\end{CompactList}\item 
const EDS\_\-fw\-Post\-Services $\ast$ \hyperlink{LSEPW_8h_a1}{LSEPW\_\-construct} (\hyperlink{struct__LSEPW}{LSEPW} $\ast$lsepw, int level, unsigned short int apid, unsigned int dgm\_\-id, LSF\_\-CPU\_\-K cpu, LSF\_\-ORIGIN\_\-K origin, unsigned int sw\_\-key, LSEW\_\-dgm\-Fw\-Poster post\-Rtn, void $\ast$post\-Prm, unsigned int $\ast$buf, int buf\_\-size)
\begin{CompactList}\small\item\em Constructs/initializes the physics application specific context. \item\end{CompactList}\item 
int \hyperlink{LSEPW_8h_a2}{LSEPW\_\-start} (\hyperlink{struct__LSEPW}{LSEPW} $\ast$lsepw, LSF\_\-REASON\_\-OPEN\_\-K reason, unsigned int run\_\-id, unsigned int start\-Time, LSF\_\-MODE\_\-K mode, unsigned int hw\_\-key, unsigned int lpa\_\-key)
\begin{CompactList}\small\item\em Start or more accurately, prepare a posting stream to receive events. \item\end{CompactList}\item 
int \hyperlink{LSEPW_8h_a3}{LSEPW\_\-notify} (\hyperlink{struct__LSEPW}{LSEPW} $\ast$lsepw, unsigned int mode, unsigned int active, const unsigned char cfgs\mbox{[}32\mbox{]}, const EDS\_\-rsd\-Tbl $\ast$rsd\-Tbl)
\begin{CompactList}\small\item\em Called when the configuration has changed, for example by a mode change. \item\end{CompactList}\item 
int \hyperlink{LSEPW_8h_a4}{LSEPW\_\-flush} (\hyperlink{struct__LSEPW}{LSEPW} $\ast$lsepw, int reason)
\begin{CompactList}\small\item\em Flushes the current datagram. \item\end{CompactList}\item 
int \hyperlink{LSEPW_8h_a5}{LSEPW\_\-level\-Set} (\hyperlink{struct__LSEPW}{LSEPW} $\ast$lsepw, int level)
\begin{CompactList}\small\item\em Modifies to the current working level to the minimum of {\em level\/} and the maximum allowable compression level that LSEPW is configured to. \item\end{CompactList}\item 
unsigned int $\ast$ \hyperlink{LSEPW_8h_a6}{LSEPW\_\-ctb\-Add} (\hyperlink{struct__LSEPW}{LSEPW} $\ast$lsepw, unsigned int $\ast$cur, int len32)
\begin{CompactList}\small\item\em Adds the Physics specific context contribution to the datagram. \item\end{CompactList}\item 
int \hyperlink{LSEPW_8h_a7}{LSEPW\_\-evt\-Add} (\hyperlink{struct__LSEPW}{LSEPW} $\ast$lsepw, EDS\_\-fw\-Ixb $\ast$ixb)
\begin{CompactList}\small\item\em Formats the event specified in by the EDS\_\-fw Information Exchange block, flushing the current record to the output stream if the datagram is full. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Interface to the physics context specific information structures and routines. 

\begin{Desc}
\item[Author:]JJRussell - \href{mailto:russell@slac.stanford.edu}{\tt russell@slac.stanford.edu}\end{Desc}


\footnotesize\begin{verbatim}   CVS $Id: LSEPW.h,v 1.6 2006/11/01 22:51:58 russell Exp $
\end{verbatim}
\normalsize


\subsection{Function Documentation}
\hypertarget{LSEPW_8h_a1}{
\index{LSEPW.h@{LSEPW.h}!LSEPW_construct@{LSEPW\_\-construct}}
\index{LSEPW_construct@{LSEPW\_\-construct}!LSEPW.h@{LSEPW.h}}
\subsubsection[LSEPW\_\-construct]{\setlength{\rightskip}{0pt plus 5cm}const EDS\_\-fw\-Post\-Services $\ast$ LSEPW\_\-construct (\hyperlink{struct__LSEPW}{LSEPW} $\ast$ {\em lsepw}, int {\em level}, unsigned short int {\em apid}, unsigned int {\em dgm\_\-id}, LSF\_\-CPU\_\-K {\em cpu}, LSF\_\-ORIGIN\_\-K {\em origin}, unsigned int {\em sw\_\-key}, LSEW\_\-dgm\-Fw\-Poster {\em post\-Rtn}, void $\ast$ {\em post\-Prm}, unsigned int $\ast$ {\em buf}, int {\em buf\_\-size})}}
\label{LSEPW_8h_a1}


Constructs/initializes the physics application specific context. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lsepw}]The physics application specific context to construct \item[{\em level}]The maximum compression level that will be used \item[{\em apid}]The application id to use in the CCSDS packets \item[{\em dgm\_\-id}]The LAT Science Format Data Id (LSF) to use \item[{\em cpu}]The originating CPU \item[{\em origin}]The data source type \item[{\em sw\_\-key}]The master software configuration key; this is the key to the Secondary Boot File. \item[{\em post\-Rtn}]Routine used to post a formatted event \item[{\em post\-Prm}]Parameter passed to the post routine \item[{\em buf}]The first, preallocated buffer to fill \item[{\em buf\_\-size}]The size, in bytes, of the ouptut buffer. Events will be packed into this buffer until full\end{description}
\end{Desc}
\hypertarget{LSEPW_8h_a6}{
\index{LSEPW.h@{LSEPW.h}!LSEPW_ctbAdd@{LSEPW\_\-ctbAdd}}
\index{LSEPW_ctbAdd@{LSEPW\_\-ctbAdd}!LSEPW.h@{LSEPW.h}}
\subsubsection[LSEPW\_\-ctbAdd]{\setlength{\rightskip}{0pt plus 5cm}unsigned int $\ast$ LSEPW\_\-ctb\-Add (\hyperlink{struct__LSEPW}{LSEPW} $\ast$ {\em lsepw}, unsigned int $\ast$ {\em cur}, int {\em len32})}}
\label{LSEPW_8h_a6}


Adds the Physics specific context contribution to the datagram. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lsepw}]The physics application specific context \item[{\em cur}]Pointer to the where to add the informaton \item[{\em len32}]The length, in 32-bit words, of the available space in the datagram\end{description}
\end{Desc}
\hypertarget{LSEPW_8h_a7}{
\index{LSEPW.h@{LSEPW.h}!LSEPW_evtAdd@{LSEPW\_\-evtAdd}}
\index{LSEPW_evtAdd@{LSEPW\_\-evtAdd}!LSEPW.h@{LSEPW.h}}
\subsubsection[LSEPW\_\-evtAdd]{\setlength{\rightskip}{0pt plus 5cm}int LSEPW\_\-evt\-Add (\hyperlink{struct__LSEPW}{LSEPW} $\ast$ {\em lsepw}, EDS\_\-fw\-Ixb $\ast$ {\em ixb})}}
\label{LSEPW_8h_a7}


Formats the event specified in by the EDS\_\-fw Information Exchange block, flushing the current record to the output stream if the datagram is full. 

\begin{Desc}
\item[Returns:]Status\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lsepw}]The physics application specific context \item[{\em ixb}]The Information Exchange Block\end{description}
\end{Desc}
\hypertarget{LSEPW_8h_a4}{
\index{LSEPW.h@{LSEPW.h}!LSEPW_flush@{LSEPW\_\-flush}}
\index{LSEPW_flush@{LSEPW\_\-flush}!LSEPW.h@{LSEPW.h}}
\subsubsection[LSEPW\_\-flush]{\setlength{\rightskip}{0pt plus 5cm}int LSEPW\_\-flush (\hyperlink{struct__LSEPW}{LSEPW} $\ast$ {\em lsepw}, int {\em reason})}}
\label{LSEPW_8h_a4}


Flushes the current datagram. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lsepw}]The physics application specific context \item[{\em reason}]The reason for the flush\end{description}
\end{Desc}
\hypertarget{LSEPW_8h_a5}{
\index{LSEPW.h@{LSEPW.h}!LSEPW_levelSet@{LSEPW\_\-levelSet}}
\index{LSEPW_levelSet@{LSEPW\_\-levelSet}!LSEPW.h@{LSEPW.h}}
\subsubsection[LSEPW\_\-levelSet]{\setlength{\rightskip}{0pt plus 5cm}int LSEPW\_\-level\-Set (\hyperlink{struct__LSEPW}{LSEPW} $\ast$ {\em lsepw}, int {\em level})}}
\label{LSEPW_8h_a5}


Modifies to the current working level to the minimum of {\em level\/} and the maximum allowable compression level that LSEPW is configured to. 

\begin{Desc}
\item[Returns:]The actual level is was set to, {\em i.e\/}. the minimum of {\em level\/} and the maximum allowable compression level. On failure this value is -1.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lsepw}]The physics application specific context \item[{\em level}]The new compression level\end{description}
\end{Desc}
\hypertarget{LSEPW_8h_a3}{
\index{LSEPW.h@{LSEPW.h}!LSEPW_notify@{LSEPW\_\-notify}}
\index{LSEPW_notify@{LSEPW\_\-notify}!LSEPW.h@{LSEPW.h}}
\subsubsection[LSEPW\_\-notify]{\setlength{\rightskip}{0pt plus 5cm}int LSEPW\_\-notify (\hyperlink{struct__LSEPW}{LSEPW} $\ast$ {\em lsepw}, unsigned int {\em mode}, unsigned int {\em active}, const unsigned char {\em cfgs}\mbox{[}32\mbox{]}, const EDS\_\-rsd\-Tbl $\ast$ {\em rsd\-Tbl})}}
\label{LSEPW_8h_a3}


Called when the configuration has changed, for example by a mode change. 

\begin{Desc}
\item[Returns:]0 if successful, non-zero if not\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lsepw}]The physics application specific context \item[{\em mode}]The new mode \item[{\em active}]The list of active handlers \item[{\em cfgs}]The current configuration for each handler. \item[{\em rsd\-Tbl}]The result summary data table\end{description}
\end{Desc}
\hypertarget{LSEPW_8h_a0}{
\index{LSEPW.h@{LSEPW.h}!LSEPW_sizeof@{LSEPW\_\-sizeof}}
\index{LSEPW_sizeof@{LSEPW\_\-sizeof}!LSEPW.h@{LSEPW.h}}
\subsubsection[LSEPW\_\-sizeof]{\setlength{\rightskip}{0pt plus 5cm}int LSEPW\_\-sizeof (int {\em level})}}
\label{LSEPW_8h_a0}


Return the size of the LSEP data structure. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em level}]The maximum compression level that will be used. Resources will be allocated consistent with supporting events written in this and all lesser compression levels.\end{description}
\end{Desc}
\hypertarget{LSEPW_8h_a2}{
\index{LSEPW.h@{LSEPW.h}!LSEPW_start@{LSEPW\_\-start}}
\index{LSEPW_start@{LSEPW\_\-start}!LSEPW.h@{LSEPW.h}}
\subsubsection[LSEPW\_\-start]{\setlength{\rightskip}{0pt plus 5cm}int LSEPW\_\-start (\hyperlink{struct__LSEPW}{LSEPW} $\ast$ {\em lsepw}, LSF\_\-REASON\_\-OPEN\_\-K {\em reason}, unsigned int {\em run\_\-id}, unsigned int {\em start\-Time}, LSF\_\-MODE\_\-K {\em mode}, unsigned int {\em hw\_\-key}, unsigned int {\em lpa\_\-key})}}
\label{LSEPW_8h_a2}


Start or more accurately, prepare a posting stream to receive events. 

\begin{Desc}
\item[Returns:]Status, currectly what LSEW\_\-dgm\-Fw\-Run\-Start returns.\end{Desc}
\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em lsepw}]The physics application specific context \item[{\em reason}]The reason why this run is being started \item[{\em run\_\-id}]The run identifier. Only the first 24-bits are used. \item[{\em start\-Time}]The run start time rounded to the nearest second \item[{\em mode}]The operational mode \item[{\em hw\_\-key}]The master hardware configuraion key; this is the key to the LATc file \item[{\em lpa\_\-key}]The LPA\_\-DB file key\end{description}
\end{Desc}
