\hypertarget{_nonin_stream_parser_8c}{
\section{nonin/src/NoninStreamParser.c File Reference}
\label{_nonin_stream_parser_8c}\index{nonin/src/NoninStreamParser.c@{nonin/src/NoninStreamParser.c}}
}
{\ttfamily \#include \char`\"{}NoninStreamParser.h\char`\"{}}\par
{\ttfamily \#include $<$stdio.h$>$}\par
\subsection*{Defines}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{_nonin_stream_parser_8c_af83e356370c60a7b838fcec5207306c2}{PARSER\_\-STATE\_\-NULL}~0x00
\item 
\#define \hyperlink{_nonin_stream_parser_8c_aa38cc7542c48f5c04a341f7ff8ca6419}{PARSER\_\-STATE\_\-SYNC}~0x01
\item 
\#define \hyperlink{_nonin_stream_parser_8c_aa29000e880fe048ae06fbe253055841d}{PARSER\_\-STATE\_\-SYNC\_\-CHECK}~0x02
\item 
\#define \hyperlink{_nonin_stream_parser_8c_ad593bf2ce0aca4e53da6493f87b3598b}{PARSER\_\-STATE\_\-PLETHMSB}~0x03
\item 
\#define \hyperlink{_nonin_stream_parser_8c_a3e3129ecc898bc0e14aef12eb07b5a21}{PARSER\_\-STATE\_\-PLETHLSB}~0x04
\item 
\#define \hyperlink{_nonin_stream_parser_8c_a986b64353711c9ca08556aff53324bce}{PARSER\_\-STATE\_\-DATA}~0x05
\item 
\#define \hyperlink{_nonin_stream_parser_8c_a8f6093f706206f01f53d21205ca5168f}{PARSER\_\-STATE\_\-CHKSUM}~0x06
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{_nonin_stream_parser_8c_a0cc5cbccbd11322f158722e195f109b2}{NONIN\_\-initParser} (\hyperlink{struct___nonin_stream_parser}{NoninStreamParser} $\ast$parser, void($\ast$handleDataValueFunc)(unsigned char frame, unsigned char plethMSB, unsigned char plethLSB, unsigned char data, void $\ast$customData), void $\ast$customData)
\item 
int \hyperlink{_nonin_stream_parser_8c_a2717b5eff125227fe4d340bacbd6f598}{NONIN\_\-parseByte} (\hyperlink{struct___nonin_stream_parser}{NoninStreamParser} $\ast$parser, unsigned char byte)
\item 
int \hyperlink{_nonin_stream_parser_8c_a1ed340264d37a7c5c79c24cbfd0c4e49}{parseFrame} (\hyperlink{struct___nonin_stream_parser}{NoninStreamParser} $\ast$parser)
\end{DoxyCompactItemize}


\subsection{Define Documentation}
\hypertarget{_nonin_stream_parser_8c_a8f6093f706206f01f53d21205ca5168f}{
\index{NoninStreamParser.c@{NoninStreamParser.c}!PARSER\_\-STATE\_\-CHKSUM@{PARSER\_\-STATE\_\-CHKSUM}}
\index{PARSER\_\-STATE\_\-CHKSUM@{PARSER\_\-STATE\_\-CHKSUM}!NoninStreamParser.c@{NoninStreamParser.c}}
\subsubsection[{PARSER\_\-STATE\_\-CHKSUM}]{\setlength{\rightskip}{0pt plus 5cm}\#define PARSER\_\-STATE\_\-CHKSUM~0x06}}
\label{_nonin_stream_parser_8c_a8f6093f706206f01f53d21205ca5168f}


Definition at line 42 of file NoninStreamParser.c.

\hypertarget{_nonin_stream_parser_8c_a986b64353711c9ca08556aff53324bce}{
\index{NoninStreamParser.c@{NoninStreamParser.c}!PARSER\_\-STATE\_\-DATA@{PARSER\_\-STATE\_\-DATA}}
\index{PARSER\_\-STATE\_\-DATA@{PARSER\_\-STATE\_\-DATA}!NoninStreamParser.c@{NoninStreamParser.c}}
\subsubsection[{PARSER\_\-STATE\_\-DATA}]{\setlength{\rightskip}{0pt plus 5cm}\#define PARSER\_\-STATE\_\-DATA~0x05}}
\label{_nonin_stream_parser_8c_a986b64353711c9ca08556aff53324bce}


Definition at line 41 of file NoninStreamParser.c.

\hypertarget{_nonin_stream_parser_8c_af83e356370c60a7b838fcec5207306c2}{
\index{NoninStreamParser.c@{NoninStreamParser.c}!PARSER\_\-STATE\_\-NULL@{PARSER\_\-STATE\_\-NULL}}
\index{PARSER\_\-STATE\_\-NULL@{PARSER\_\-STATE\_\-NULL}!NoninStreamParser.c@{NoninStreamParser.c}}
\subsubsection[{PARSER\_\-STATE\_\-NULL}]{\setlength{\rightskip}{0pt plus 5cm}\#define PARSER\_\-STATE\_\-NULL~0x00}}
\label{_nonin_stream_parser_8c_af83e356370c60a7b838fcec5207306c2}


Definition at line 36 of file NoninStreamParser.c.

\hypertarget{_nonin_stream_parser_8c_a3e3129ecc898bc0e14aef12eb07b5a21}{
\index{NoninStreamParser.c@{NoninStreamParser.c}!PARSER\_\-STATE\_\-PLETHLSB@{PARSER\_\-STATE\_\-PLETHLSB}}
\index{PARSER\_\-STATE\_\-PLETHLSB@{PARSER\_\-STATE\_\-PLETHLSB}!NoninStreamParser.c@{NoninStreamParser.c}}
\subsubsection[{PARSER\_\-STATE\_\-PLETHLSB}]{\setlength{\rightskip}{0pt plus 5cm}\#define PARSER\_\-STATE\_\-PLETHLSB~0x04}}
\label{_nonin_stream_parser_8c_a3e3129ecc898bc0e14aef12eb07b5a21}


Definition at line 40 of file NoninStreamParser.c.

\hypertarget{_nonin_stream_parser_8c_ad593bf2ce0aca4e53da6493f87b3598b}{
\index{NoninStreamParser.c@{NoninStreamParser.c}!PARSER\_\-STATE\_\-PLETHMSB@{PARSER\_\-STATE\_\-PLETHMSB}}
\index{PARSER\_\-STATE\_\-PLETHMSB@{PARSER\_\-STATE\_\-PLETHMSB}!NoninStreamParser.c@{NoninStreamParser.c}}
\subsubsection[{PARSER\_\-STATE\_\-PLETHMSB}]{\setlength{\rightskip}{0pt plus 5cm}\#define PARSER\_\-STATE\_\-PLETHMSB~0x03}}
\label{_nonin_stream_parser_8c_ad593bf2ce0aca4e53da6493f87b3598b}


Definition at line 39 of file NoninStreamParser.c.

\hypertarget{_nonin_stream_parser_8c_aa38cc7542c48f5c04a341f7ff8ca6419}{
\index{NoninStreamParser.c@{NoninStreamParser.c}!PARSER\_\-STATE\_\-SYNC@{PARSER\_\-STATE\_\-SYNC}}
\index{PARSER\_\-STATE\_\-SYNC@{PARSER\_\-STATE\_\-SYNC}!NoninStreamParser.c@{NoninStreamParser.c}}
\subsubsection[{PARSER\_\-STATE\_\-SYNC}]{\setlength{\rightskip}{0pt plus 5cm}\#define PARSER\_\-STATE\_\-SYNC~0x01}}
\label{_nonin_stream_parser_8c_aa38cc7542c48f5c04a341f7ff8ca6419}


Definition at line 37 of file NoninStreamParser.c.

\hypertarget{_nonin_stream_parser_8c_aa29000e880fe048ae06fbe253055841d}{
\index{NoninStreamParser.c@{NoninStreamParser.c}!PARSER\_\-STATE\_\-SYNC\_\-CHECK@{PARSER\_\-STATE\_\-SYNC\_\-CHECK}}
\index{PARSER\_\-STATE\_\-SYNC\_\-CHECK@{PARSER\_\-STATE\_\-SYNC\_\-CHECK}!NoninStreamParser.c@{NoninStreamParser.c}}
\subsubsection[{PARSER\_\-STATE\_\-SYNC\_\-CHECK}]{\setlength{\rightskip}{0pt plus 5cm}\#define PARSER\_\-STATE\_\-SYNC\_\-CHECK~0x02}}
\label{_nonin_stream_parser_8c_aa29000e880fe048ae06fbe253055841d}


Definition at line 38 of file NoninStreamParser.c.



\subsection{Function Documentation}
\hypertarget{_nonin_stream_parser_8c_a0cc5cbccbd11322f158722e195f109b2}{
\index{NoninStreamParser.c@{NoninStreamParser.c}!NONIN\_\-initParser@{NONIN\_\-initParser}}
\index{NONIN\_\-initParser@{NONIN\_\-initParser}!NoninStreamParser.c@{NoninStreamParser.c}}
\subsubsection[{NONIN\_\-initParser}]{\setlength{\rightskip}{0pt plus 5cm}int NONIN\_\-initParser ({\bf NoninStreamParser} $\ast$ {\em parser}, \/  void($\ast$)(unsigned char frame, unsigned char plethMSB, unsigned char plethLSB, unsigned char data, void $\ast$customData) {\em handleDataValueFunc}, \/  void $\ast$ {\em customData})}}
\label{_nonin_stream_parser_8c_a0cc5cbccbd11322f158722e195f109b2}

\begin{DoxyParams}{Parameters}
\item[{\em parser}]Pointer to a NoninStreamParser object. \item[{\em parserType}]One of the PARSER\_\-TYPE\_\-$\ast$ constants defined above: PARSER\_\-TYPE\_\-PACKETS or PARSER\_\-TYPE\_\-2BYTERAW. \item[{\em handleDataValueFunc}]A user-\/defined callback function that will be called whenever a data value is parsed from a Packet. \item[{\em customData}]A pointer to any arbitrary data that will also be passed to the handleDataValueFunc whenever a data value is parsed from a Packet.\end{DoxyParams}
\begin{DoxyReturn}{Returns}
-\/1 if {\ttfamily parser} is NULL. 

-\/2 if {\ttfamily parserType} is invalid. 

0 on success. 
\end{DoxyReturn}


Definition at line 48 of file NoninStreamParser.c.

\hypertarget{_nonin_stream_parser_8c_a2717b5eff125227fe4d340bacbd6f598}{
\index{NoninStreamParser.c@{NoninStreamParser.c}!NONIN\_\-parseByte@{NONIN\_\-parseByte}}
\index{NONIN\_\-parseByte@{NONIN\_\-parseByte}!NoninStreamParser.c@{NoninStreamParser.c}}
\subsubsection[{NONIN\_\-parseByte}]{\setlength{\rightskip}{0pt plus 5cm}int NONIN\_\-parseByte ({\bf NoninStreamParser} $\ast$ {\em parser}, \/  unsigned char {\em byte})}}
\label{_nonin_stream_parser_8c_a2717b5eff125227fe4d340bacbd6f598}


Definition at line 69 of file NoninStreamParser.c.

\hypertarget{_nonin_stream_parser_8c_a1ed340264d37a7c5c79c24cbfd0c4e49}{
\index{NoninStreamParser.c@{NoninStreamParser.c}!parseFrame@{parseFrame}}
\index{parseFrame@{parseFrame}!NoninStreamParser.c@{NoninStreamParser.c}}
\subsubsection[{parseFrame}]{\setlength{\rightskip}{0pt plus 5cm}int parseFrame ({\bf NoninStreamParser} $\ast$ {\em parser})}}
\label{_nonin_stream_parser_8c_a1ed340264d37a7c5c79c24cbfd0c4e49}
Parses each row of data from the {\ttfamily packet's} Data\mbox{[}\mbox{]} block, updating the fields of {\ttfamily data} as appropriate. 

Definition at line 142 of file NoninStreamParser.c.

