\hypertarget{decode_8c}{
\section{decode.c File Reference}
\label{decode_8c}\index{decode.c@{decode.c}}
}
Routines for unpacking the payload of a result item.  


{\tt \#include $<$LEM/defs.h$>$}\par
{\tt \#include $<$LEM/decode.h$>$}\par
{\tt \#include $<$decode.ih$>$}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{decode_8c_117e3cf7c345fcbfc900a5bd2aa3daf3}{CRU\_\-decode} (const unsigned short $\ast$pkt, unsigned $\ast$value)
\begin{CompactList}\small\item\em Copy the CRU response from a result item. \item\end{CompactList}\item 
void \hyperlink{decode_8c_5df51d68fa8856555aa7c98398f0e432}{GEM\_\-decode} (const unsigned short $\ast$pkt, unsigned $\ast$value)
\begin{CompactList}\small\item\em Copy the GEM response from a result item. \item\end{CompactList}\item 
void \hyperlink{decode_8c_984ed1f11338b24aefe3672496465fed}{EBM\_\-decode} (const unsigned short $\ast$pkt, unsigned $\ast$value)
\begin{CompactList}\small\item\em Copy the EBM response from a result item. \item\end{CompactList}\item 
void \hyperlink{decode_8c_07746d95b41416b75a5399c9cda9338b}{PDU\_\-decode} (const unsigned short $\ast$pkt, unsigned $\ast$value)
\begin{CompactList}\small\item\em Copy the PDU response from a result item. \item\end{CompactList}\item 
void \hyperlink{decode_8c_4210abc1d7c4693f33b95214ae29493e}{TIC\_\-decode} (const unsigned short $\ast$pkt, unsigned $\ast$value)
\begin{CompactList}\small\item\em Copy the TIC response from a result item. \item\end{CompactList}\item 
void \hyperlink{decode_8c_e1e49fe07249949e8179cb7f0d2d90ee}{TEM\_\-decode} (const unsigned short $\ast$pkt, unsigned $\ast$value)
\begin{CompactList}\small\item\em Copy the TEM response from a result item. \item\end{CompactList}\item 
void \hyperlink{decode_8c_2122e02f5f584689a79737b26147a338}{CCC\_\-decode} (const unsigned short $\ast$pkt, unsigned $\ast$value)
\begin{CompactList}\small\item\em Copy the CCC response from a result item. \item\end{CompactList}\item 
void \hyperlink{decode_8c_98faf8564c1edc1f6a6c5ec33cc2a62d}{CRC\_\-decode} (const unsigned short $\ast$pkt, \hyperlink{unionCAL__rsp}{CAL\_\-rsp} $\ast$rsp)
\begin{CompactList}\small\item\em Copy the CRC response from a result item. \item\end{CompactList}\item 
void \hyperlink{decode_8c_03bd526d86c0574a467b1743bd8e193f}{CFE\_\-decode} (const unsigned short $\ast$pkt, \hyperlink{unionCAL__rsp}{CAL\_\-rsp} $\ast$rsp)
\begin{CompactList}\small\item\em Copy the CFE response from a result item. \item\end{CompactList}\item 
void \hyperlink{decode_8c_7ca01ebd09331c60c7cdc2c3cfdf84ae}{TCC\_\-decode} (const unsigned short $\ast$pkt, unsigned $\ast$value)
\begin{CompactList}\small\item\em Copy the TCC response from a result item. \item\end{CompactList}\item 
void \hyperlink{decode_8c_162efdb56b77245932908c31e26245dc}{TRC\_\-decode} (const unsigned short $\ast$pkt, \hyperlink{structTKR__rsp}{TKR\_\-rsp} $\ast$rsp)
\begin{CompactList}\small\item\em Copy the TRC response from a result item. \item\end{CompactList}\item 
void \hyperlink{decode_8c_d3b2720feed724e104df90c56088fce2}{TFE\_\-decode} (const unsigned short $\ast$pkt, \hyperlink{structTKR__rsp}{TKR\_\-rsp} $\ast$rsp)
\begin{CompactList}\small\item\em Copy the TFE response from a result item. \item\end{CompactList}\item 
void \hyperlink{decode_8c_48f0acbfbb78537c9fab93e596ad26ef}{TDC\_\-decode} (const unsigned short $\ast$pkt, \hyperlink{structTKR__rsp}{TKR\_\-rsp} $\ast$rsp)
\begin{CompactList}\small\item\em Copy the TFE DAC response from a result item. \item\end{CompactList}\item 
void \hyperlink{decode_8c_ae27f5590efd0f8d01205a5e2138b3a5}{AEM\_\-decode} (const unsigned short $\ast$pkt, unsigned $\ast$value)
\begin{CompactList}\small\item\em Copy the AEM response from a result item. \item\end{CompactList}\item 
void \hyperlink{decode_8c_21ebf6b5102040043c2e8e0d885aaac2}{ARC\_\-decode} (const unsigned short $\ast$pkt, \hyperlink{unionACD__rsp}{ACD\_\-rsp} $\ast$rsp)
\begin{CompactList}\small\item\em Copy the ARC response from a result item. \item\end{CompactList}\item 
void \hyperlink{decode_8c_a3081789b20376b4ab4f76c9a1710bd2}{AFE\_\-decode} (const unsigned short $\ast$pkt, \hyperlink{unionACD__rsp}{ACD\_\-rsp} $\ast$rsp)
\begin{CompactList}\small\item\em Copy the AFE response from a result item. \item\end{CompactList}\item 
void \hyperlink{decode_8c_f49dfc0ab299b15b9e595e2d49fa14cf}{PDU\_\-ENV\_\-decode} (const unsigned short $\ast$pkt, \hyperlink{structPDU__env__rsp}{PDU\_\-env\_\-rsp} $\ast$rsp)
\begin{CompactList}\small\item\em Copy the PDU ENV response from a result item. \item\end{CompactList}\item 
void \hyperlink{decode_8c_cb06cbf2ef789479ce57d1e6def83709}{TIC\_\-ENV\_\-decode} (const unsigned short $\ast$pkt, \hyperlink{structTIC__env__rsp}{TIC\_\-env\_\-rsp} $\ast$rsp)
\begin{CompactList}\small\item\em Copy the TIC ENV response from a result item. \item\end{CompactList}\item 
void \hyperlink{decode_8c_8d18f97af966a6fe1f671dd181a749d3}{AEM\_\-ENV\_\-decode} (const unsigned short $\ast$pkt, \hyperlink{unionAEM__env__rsp}{AEM\_\-env\_\-rsp} $\ast$rsp)
\begin{CompactList}\small\item\em Copy the AEM ENV response from a result item. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Routines for unpacking the payload of a result item. 

\begin{Desc}
\item[Author:]James Swain \& Owen Saxton\end{Desc}
{\bf \$Id:} \hyperlink{decode_8c}{decode.c},v 1.8 2011/03/25 18:51:53 apw Exp \$ 

\subsection{Function Documentation}
\hypertarget{decode_8c_ae27f5590efd0f8d01205a5e2138b3a5}{
\index{decode.c@{decode.c}!AEM\_\-decode@{AEM\_\-decode}}
\index{AEM\_\-decode@{AEM\_\-decode}!decode.c@{decode.c}}
\subsubsection[{AEM\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}void AEM\_\-decode (const unsigned short $\ast$ {\em pkt}, \/  unsigned $\ast$ {\em value})}}
\label{decode_8c_ae27f5590efd0f8d01205a5e2138b3a5}


Copy the AEM response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload\item[{\em value}]Pointer to location to store result \end{description}
\end{Desc}


References decode\_\-ul().\hypertarget{decode_8c_8d18f97af966a6fe1f671dd181a749d3}{
\index{decode.c@{decode.c}!AEM\_\-ENV\_\-decode@{AEM\_\-ENV\_\-decode}}
\index{AEM\_\-ENV\_\-decode@{AEM\_\-ENV\_\-decode}!decode.c@{decode.c}}
\subsubsection[{AEM\_\-ENV\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}void AEM\_\-ENV\_\-decode (const unsigned short $\ast$ {\em pkt}, \/  {\bf AEM\_\-env\_\-rsp} $\ast$ {\em rsp})}}
\label{decode_8c_8d18f97af966a6fe1f671dd181a749d3}


Copy the AEM ENV response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload\item[{\em rsp}]Pointer to memory to hold decoded environmental monitor response data \end{description}
\end{Desc}


References AEM\_\-env\_\-rsp::ul.\hypertarget{decode_8c_a3081789b20376b4ab4f76c9a1710bd2}{
\index{decode.c@{decode.c}!AFE\_\-decode@{AFE\_\-decode}}
\index{AFE\_\-decode@{AFE\_\-decode}!decode.c@{decode.c}}
\subsubsection[{AFE\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}void AFE\_\-decode (const unsigned short $\ast$ {\em pkt}, \/  {\bf ACD\_\-rsp} $\ast$ {\em rsp})}}
\label{decode_8c_a3081789b20376b4ab4f76c9a1710bd2}


Copy the AFE response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload\item[{\em rsp}]Pointer to location to store result \end{description}
\end{Desc}


References decode\_\-acd().\hypertarget{decode_8c_21ebf6b5102040043c2e8e0d885aaac2}{
\index{decode.c@{decode.c}!ARC\_\-decode@{ARC\_\-decode}}
\index{ARC\_\-decode@{ARC\_\-decode}!decode.c@{decode.c}}
\subsubsection[{ARC\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}void ARC\_\-decode (const unsigned short $\ast$ {\em pkt}, \/  {\bf ACD\_\-rsp} $\ast$ {\em rsp})}}
\label{decode_8c_21ebf6b5102040043c2e8e0d885aaac2}


Copy the ARC response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload\item[{\em rsp}]Pointer to location to store result \end{description}
\end{Desc}


References decode\_\-acd().\hypertarget{decode_8c_2122e02f5f584689a79737b26147a338}{
\index{decode.c@{decode.c}!CCC\_\-decode@{CCC\_\-decode}}
\index{CCC\_\-decode@{CCC\_\-decode}!decode.c@{decode.c}}
\subsubsection[{CCC\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}void CCC\_\-decode (const unsigned short $\ast$ {\em pkt}, \/  unsigned $\ast$ {\em value})}}
\label{decode_8c_2122e02f5f584689a79737b26147a338}


Copy the CCC response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload\item[{\em value}]Pointer to location to store result \end{description}
\end{Desc}


References decode\_\-ul().\hypertarget{decode_8c_03bd526d86c0574a467b1743bd8e193f}{
\index{decode.c@{decode.c}!CFE\_\-decode@{CFE\_\-decode}}
\index{CFE\_\-decode@{CFE\_\-decode}!decode.c@{decode.c}}
\subsubsection[{CFE\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}void CFE\_\-decode (const unsigned short $\ast$ {\em pkt}, \/  {\bf CAL\_\-rsp} $\ast$ {\em rsp})}}
\label{decode_8c_03bd526d86c0574a467b1743bd8e193f}


Copy the CFE response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload\item[{\em rsp}]Pointer to location to store result \end{description}
\end{Desc}


References decode\_\-cal().\hypertarget{decode_8c_98faf8564c1edc1f6a6c5ec33cc2a62d}{
\index{decode.c@{decode.c}!CRC\_\-decode@{CRC\_\-decode}}
\index{CRC\_\-decode@{CRC\_\-decode}!decode.c@{decode.c}}
\subsubsection[{CRC\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}void CRC\_\-decode (const unsigned short $\ast$ {\em pkt}, \/  {\bf CAL\_\-rsp} $\ast$ {\em rsp})}}
\label{decode_8c_98faf8564c1edc1f6a6c5ec33cc2a62d}


Copy the CRC response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload\item[{\em rsp}]Pointer to location to store result \end{description}
\end{Desc}


References decode\_\-cal().\hypertarget{decode_8c_117e3cf7c345fcbfc900a5bd2aa3daf3}{
\index{decode.c@{decode.c}!CRU\_\-decode@{CRU\_\-decode}}
\index{CRU\_\-decode@{CRU\_\-decode}!decode.c@{decode.c}}
\subsubsection[{CRU\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}void CRU\_\-decode (const unsigned short $\ast$ {\em pkt}, \/  unsigned $\ast$ {\em value})}}
\label{decode_8c_117e3cf7c345fcbfc900a5bd2aa3daf3}


Copy the CRU response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload\item[{\em value}]Pointer to location to store result \end{description}
\end{Desc}


References decode\_\-ul().\hypertarget{decode_8c_984ed1f11338b24aefe3672496465fed}{
\index{decode.c@{decode.c}!EBM\_\-decode@{EBM\_\-decode}}
\index{EBM\_\-decode@{EBM\_\-decode}!decode.c@{decode.c}}
\subsubsection[{EBM\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}void EBM\_\-decode (const unsigned short $\ast$ {\em pkt}, \/  unsigned $\ast$ {\em value})}}
\label{decode_8c_984ed1f11338b24aefe3672496465fed}


Copy the EBM response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload\item[{\em value}]Pointer to location to store result \end{description}
\end{Desc}


References decode\_\-ul().\hypertarget{decode_8c_5df51d68fa8856555aa7c98398f0e432}{
\index{decode.c@{decode.c}!GEM\_\-decode@{GEM\_\-decode}}
\index{GEM\_\-decode@{GEM\_\-decode}!decode.c@{decode.c}}
\subsubsection[{GEM\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}void GEM\_\-decode (const unsigned short $\ast$ {\em pkt}, \/  unsigned $\ast$ {\em value})}}
\label{decode_8c_5df51d68fa8856555aa7c98398f0e432}


Copy the GEM response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload\item[{\em value}]Pointer to location to store result \end{description}
\end{Desc}


References decode\_\-ul().\hypertarget{decode_8c_07746d95b41416b75a5399c9cda9338b}{
\index{decode.c@{decode.c}!PDU\_\-decode@{PDU\_\-decode}}
\index{PDU\_\-decode@{PDU\_\-decode}!decode.c@{decode.c}}
\subsubsection[{PDU\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}void PDU\_\-decode (const unsigned short $\ast$ {\em pkt}, \/  unsigned $\ast$ {\em value})}}
\label{decode_8c_07746d95b41416b75a5399c9cda9338b}


Copy the PDU response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload\item[{\em value}]Pointer to location to store result \end{description}
\end{Desc}


References decode\_\-ul().\hypertarget{decode_8c_f49dfc0ab299b15b9e595e2d49fa14cf}{
\index{decode.c@{decode.c}!PDU\_\-ENV\_\-decode@{PDU\_\-ENV\_\-decode}}
\index{PDU\_\-ENV\_\-decode@{PDU\_\-ENV\_\-decode}!decode.c@{decode.c}}
\subsubsection[{PDU\_\-ENV\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}void PDU\_\-ENV\_\-decode (const unsigned short $\ast$ {\em pkt}, \/  {\bf PDU\_\-env\_\-rsp} $\ast$ {\em rsp})}}
\label{decode_8c_f49dfc0ab299b15b9e595e2d49fa14cf}


Copy the PDU ENV response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload\item[{\em rsp}]Pointer to location to store result \end{description}
\end{Desc}


References decode\_\-ul(), and PDU\_\-env\_\-rsp::ui.\hypertarget{decode_8c_7ca01ebd09331c60c7cdc2c3cfdf84ae}{
\index{decode.c@{decode.c}!TCC\_\-decode@{TCC\_\-decode}}
\index{TCC\_\-decode@{TCC\_\-decode}!decode.c@{decode.c}}
\subsubsection[{TCC\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}void TCC\_\-decode (const unsigned short $\ast$ {\em pkt}, \/  unsigned $\ast$ {\em value})}}
\label{decode_8c_7ca01ebd09331c60c7cdc2c3cfdf84ae}


Copy the TCC response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload\item[{\em value}]Pointer to location to store result \end{description}
\end{Desc}


References decode\_\-ul().\hypertarget{decode_8c_48f0acbfbb78537c9fab93e596ad26ef}{
\index{decode.c@{decode.c}!TDC\_\-decode@{TDC\_\-decode}}
\index{TDC\_\-decode@{TDC\_\-decode}!decode.c@{decode.c}}
\subsubsection[{TDC\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}void TDC\_\-decode (const unsigned short $\ast$ {\em pkt}, \/  {\bf TKR\_\-rsp} $\ast$ {\em rsp})}}
\label{decode_8c_48f0acbfbb78537c9fab93e596ad26ef}


Copy the TFE DAC response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload\item[{\em rsp}]Pointer to location to store result \end{description}
\end{Desc}


References decode\_\-tkr(), rotate\_\-(), and TKR\_\-rsp::value.\hypertarget{decode_8c_e1e49fe07249949e8179cb7f0d2d90ee}{
\index{decode.c@{decode.c}!TEM\_\-decode@{TEM\_\-decode}}
\index{TEM\_\-decode@{TEM\_\-decode}!decode.c@{decode.c}}
\subsubsection[{TEM\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}void TEM\_\-decode (const unsigned short $\ast$ {\em pkt}, \/  unsigned $\ast$ {\em value})}}
\label{decode_8c_e1e49fe07249949e8179cb7f0d2d90ee}


Copy the TEM response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload\item[{\em value}]Pointer to location to store result \end{description}
\end{Desc}


References decode\_\-ul().\hypertarget{decode_8c_d3b2720feed724e104df90c56088fce2}{
\index{decode.c@{decode.c}!TFE\_\-decode@{TFE\_\-decode}}
\index{TFE\_\-decode@{TFE\_\-decode}!decode.c@{decode.c}}
\subsubsection[{TFE\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}void TFE\_\-decode (const unsigned short $\ast$ {\em pkt}, \/  {\bf TKR\_\-rsp} $\ast$ {\em rsp})}}
\label{decode_8c_d3b2720feed724e104df90c56088fce2}


Copy the TFE response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload\item[{\em rsp}]Pointer to location to store result \end{description}
\end{Desc}


References decode\_\-tkr().\hypertarget{decode_8c_4210abc1d7c4693f33b95214ae29493e}{
\index{decode.c@{decode.c}!TIC\_\-decode@{TIC\_\-decode}}
\index{TIC\_\-decode@{TIC\_\-decode}!decode.c@{decode.c}}
\subsubsection[{TIC\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}void TIC\_\-decode (const unsigned short $\ast$ {\em pkt}, \/  unsigned $\ast$ {\em value})}}
\label{decode_8c_4210abc1d7c4693f33b95214ae29493e}


Copy the TIC response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload\item[{\em value}]Pointer to location to store result \end{description}
\end{Desc}


References decode\_\-ul().\hypertarget{decode_8c_cb06cbf2ef789479ce57d1e6def83709}{
\index{decode.c@{decode.c}!TIC\_\-ENV\_\-decode@{TIC\_\-ENV\_\-decode}}
\index{TIC\_\-ENV\_\-decode@{TIC\_\-ENV\_\-decode}!decode.c@{decode.c}}
\subsubsection[{TIC\_\-ENV\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}void TIC\_\-ENV\_\-decode (const unsigned short $\ast$ {\em pkt}, \/  {\bf TIC\_\-env\_\-rsp} $\ast$ {\em rsp})}}
\label{decode_8c_cb06cbf2ef789479ce57d1e6def83709}


Copy the TIC ENV response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload\item[{\em rsp}]Pointer to structure holding storage for for 8 16-bit values, the mux channel number that was acquired and the acquisition valid bit. \end{description}
\end{Desc}


References TIC\_\-env\_\-rsp::chnl, TIC\_\-env\_\-rsp::env, and TIC\_\-env\_\-rsp::valid.\hypertarget{decode_8c_162efdb56b77245932908c31e26245dc}{
\index{decode.c@{decode.c}!TRC\_\-decode@{TRC\_\-decode}}
\index{TRC\_\-decode@{TRC\_\-decode}!decode.c@{decode.c}}
\subsubsection[{TRC\_\-decode}]{\setlength{\rightskip}{0pt plus 5cm}void TRC\_\-decode (const unsigned short $\ast$ {\em pkt}, \/  {\bf TKR\_\-rsp} $\ast$ {\em rsp})}}
\label{decode_8c_162efdb56b77245932908c31e26245dc}


Copy the TRC response from a result item. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pkt}]Pointer to result item payload\item[{\em rsp}]Pointer to location to store result \end{description}
\end{Desc}


References decode\_\-tkr().