\hypertarget{GPS_8c}{
\section{GPS.c File Reference}
\label{GPS_8c}\index{GPS.c@{GPS.c}}
}
Balloon Flight GPS utilities, Implementation. 


{\tt \#include $<$stdlib.h$>$}\par
{\tt \#include $<$unistd.h$>$}\par
{\tt \#include $<$fcntl.h$>$}\par
{\tt \#include $<$time.h$>$}\par
{\tt \#include \char`\"{}BBC/GPS.h\char`\"{}}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{GPS_8c_a0}{
\index{SL_ERROR@{SL\_\-ERROR}!GPS.c@{GPS.c}}\index{GPS.c@{GPS.c}!SL_ERROR@{SL\_\-ERROR}}
\#define \hyperlink{GPS_8c_a0}{SL\_\-ERROR}\ -1}
\label{GPS_8c_a0}

\begin{CompactList}\small\item\em Error on a serial line operation.\item\end{CompactList}\item 
\hypertarget{GPS_8c_a1}{
\index{PREAMBLE@{PREAMBLE}!GPS.c@{GPS.c}}\index{GPS.c@{GPS.c}!PREAMBLE@{PREAMBLE}}
\#define \hyperlink{GPS_8c_a1}{PREAMBLE}\ (( '@' $<$$<$ 24) $|$ ('@'  $<$$<$ 16) $|$ ('E' $<$$<$  8) $|$ ('q' $<$$<$  0))}
\label{GPS_8c_a1}

\begin{CompactList}\small\item\em Internal constant for @Eq.\item\end{CompactList}\item 
\hypertarget{GPS_8c_a2}{
\index{POSTAMBLE@{POSTAMBLE}!GPS.c@{GPS.c}}\index{GPS.c@{GPS.c}!POSTAMBLE@{POSTAMBLE}}
\#define \hyperlink{GPS_8c_a2}{POSTAMBLE}\ (('$\backslash$r' $<$$<$  8) $|$ ('$\backslash$n' $<$$<$  0))}
\label{GPS_8c_a2}

\begin{CompactList}\small\item\em Internal constant for CR LF.\item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
int \hyperlink{GPS_8c_a3}{set\_\-baud\_\-rate} (int fd, int rate)
\begin{CompactList}\small\item\em Sets the BAUD rate.\item\end{CompactList}\item 
int \hyperlink{GPS_8c_a4}{set\_\-raw\_\-mode} (int fd)
\begin{CompactList}\small\item\em Sets the serial line into raw mode.\item\end{CompactList}\item 
int \hyperlink{GPS_8c_a5}{flush\_\-stream} (int fd)
\begin{CompactList}\small\item\em Flushs the serial line.\item\end{CompactList}\item 
unsigned int \hyperlink{GPS_8c_a6}{cvt2} (const unsigned char $\ast$beg)
\begin{CompactList}\small\item\em Converts 2 digit string to a number, base 10.\item\end{CompactList}\item 
\hypertarget{GPS_8c_a7}{
\index{GPS_verify@{GPS\_\-verify}!GPS.c@{GPS.c}}\index{GPS.c@{GPS.c}!GPS_verify@{GPS\_\-verify}}
\hyperlink{GPS_8h_a1}{GPS\_\-status} {\bf GPS\_\-verify} (const unsigned char buf\mbox{[}GPS\_\-K\_\-PM\_\-MBF\_\-SIZE\mbox{]})}
\label{GPS_8c_a7}

\item 
\hypertarget{GPS_8c_a8}{
\index{GPS_checksum_verify@{GPS\_\-checksum\_\-verify}!GPS.c@{GPS.c}}\index{GPS.c@{GPS.c}!GPS_checksum_verify@{GPS\_\-checksum\_\-verify}}
int {\bf GPS\_\-checksum\_\-verify} (const unsigned char buf\mbox{[}GPS\_\-K\_\-PM\_\-MBF\_\-SIZE\mbox{]})}
\label{GPS_8c_a8}

\item 
\hypertarget{GPS_8c_a9}{
\index{GPS_init@{GPS\_\-init}!GPS.c@{GPS.c}}\index{GPS.c@{GPS.c}!GPS_init@{GPS\_\-init}}
int {\bf GPS\_\-init} (int fd)}
\label{GPS_8c_a9}

\item 
\hypertarget{GPS_8c_a10}{
\index{GPS_open@{GPS\_\-open}!GPS.c@{GPS.c}}\index{GPS.c@{GPS.c}!GPS_open@{GPS\_\-open}}
int {\bf GPS\_\-open} (const char $\ast$dev\_\-name)}
\label{GPS_8c_a10}

\item 
\hypertarget{GPS_8c_a11}{
\index{GPS_read@{GPS\_\-read}!GPS.c@{GPS.c}}\index{GPS.c@{GPS.c}!GPS_read@{GPS\_\-read}}
int {\bf GPS\_\-read} (int fd, unsigned char buf\mbox{[}GPS\_\-K\_\-PM\_\-MBF\_\-SIZE\mbox{]})}
\label{GPS_8c_a11}

\item 
\hypertarget{GPS_8c_a12}{
\index{GPS_rate_set@{GPS\_\-rate\_\-set}!GPS.c@{GPS.c}}\index{GPS.c@{GPS.c}!GPS_rate_set@{GPS\_\-rate\_\-set}}
int {\bf GPS\_\-rate\_\-set} (int fd, int rate)}
\label{GPS_8c_a12}

\item 
\hypertarget{GPS_8c_a13}{
\index{GPS_utc_get@{GPS\_\-utc\_\-get}!GPS.c@{GPS.c}}\index{GPS.c@{GPS.c}!GPS_utc_get@{GPS\_\-utc\_\-get}}
time\_\-t {\bf GPS\_\-utc\_\-get} (const unsigned char buf\mbox{[}GPS\_\-K\_\-PM\_\-MBF\_\-SIZE\mbox{]})}
\label{GPS_8c_a13}

\end{CompactItemize}


\subsection{Detailed Description}
Balloon Flight GPS utilities, Implementation.



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


\subsection{Function Documentation}
\hypertarget{GPS_8c_a6}{
\index{GPS.c@{GPS.c}!cvt2@{cvt2}}
\index{cvt2@{cvt2}!GPS.c@{GPS.c}}
\subsubsection[cvt2]{\setlength{\rightskip}{0pt plus 5cm}unsigned int cvt2 (const unsigned char $\ast$ {\em beg})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{GPS_8c_a6}


Converts 2 digit string to a number, base 10.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
beg}]Pointer to the first character to be converted. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
The UTC time. \end{Desc}
\hypertarget{GPS_8c_a5}{
\index{GPS.c@{GPS.c}!flush_stream@{flush\_\-stream}}
\index{flush_stream@{flush\_\-stream}!GPS.c@{GPS.c}}
\subsubsection[flush\_\-stream]{\setlength{\rightskip}{0pt plus 5cm}int flush\_\-stream (int {\em fd})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{GPS_8c_a5}


Flushs the serial line.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
fd}]The file descriptor of the serial line \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
Status \end{Desc}
\hypertarget{GPS_8c_a3}{
\index{GPS.c@{GPS.c}!set_baud_rate@{set\_\-baud\_\-rate}}
\index{set_baud_rate@{set\_\-baud\_\-rate}!GPS.c@{GPS.c}}
\subsubsection[set\_\-baud\_\-rate]{\setlength{\rightskip}{0pt plus 5cm}int set\_\-baud\_\-rate (int {\em fd}, int {\em rate})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{GPS_8c_a3}


Sets the BAUD rate.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
fd}]The file descriptor of the serial line \item[{\em 
rate}]The baud rate to set. \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
Status \end{Desc}
\hypertarget{GPS_8c_a4}{
\index{GPS.c@{GPS.c}!set_raw_mode@{set\_\-raw\_\-mode}}
\index{set_raw_mode@{set\_\-raw\_\-mode}!GPS.c@{GPS.c}}
\subsubsection[set\_\-raw\_\-mode]{\setlength{\rightskip}{0pt plus 5cm}int set\_\-raw\_\-mode (int {\em fd})\hspace{0.3cm}{\tt  \mbox{[}inline, static\mbox{]}}}}
\label{GPS_8c_a4}


Sets the serial line into raw mode.

\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
fd}]The file descriptor of the serial line \end{description}
\end{Desc}
\begin{Desc}
\item[Returns: ]\par
Status \end{Desc}
