\doxysection{3GPP TS 23.032 GAD\+: Universal Geographical Area Description.}
\label{group__gad}\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsection*{Files}
\begin{DoxyCompactItemize}
\item 
file \textbf{ gad.\+h}
\begin{DoxyCompactList}\small\item\em Message encoding and decoding for 3GPP TS 23.\+032 GAD\+: Universal Geographical Area Description. \end{DoxyCompactList}\item 
file \textbf{ gsm\+\_\+23\+\_\+032.\+h}
\item 
file \textbf{ gad.\+c}
\begin{DoxyCompactList}\small\item\em Message encoding and decoding for 3GPP TS 23.\+032 GAD\+: Universal Geographical Area Description. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point}
\item 
struct \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle}
\item 
struct \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point\+\_\+unc\+\_\+ellipse}
\item 
struct \textbf{ osmo\+\_\+gad\+\_\+polygon}
\item 
struct \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point\+\_\+alt}
\item 
struct \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point\+\_\+alt\+\_\+unc\+\_\+ell}
\item 
struct \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+arc}
\item 
struct \textbf{ osmo\+\_\+gad\+\_\+ha\+\_\+ell\+\_\+point\+\_\+alt\+\_\+unc\+\_\+ell}
\item 
struct \textbf{ osmo\+\_\+gad}
\item 
struct \textbf{ osmo\+\_\+gad\+\_\+err}
\item 
struct \textbf{ gad\+\_\+raw\+\_\+head}
\item 
struct \textbf{ gad\+\_\+raw\+\_\+ell\+\_\+point}
\item 
struct \textbf{ gad\+\_\+raw\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle}
\item 
struct \textbf{ gad\+\_\+raw\+\_\+ell\+\_\+point\+\_\+unc\+\_\+ellipse}
\item 
struct \textbf{ gad\+\_\+raw\+\_\+polygon}
\item 
struct \textbf{ gad\+\_\+raw\+\_\+ell\+\_\+point\+\_\+alt}
\item 
struct \textbf{ gad\+\_\+raw\+\_\+ell\+\_\+point\+\_\+alt\+\_\+unc\+\_\+ell}
\item 
struct \textbf{ gad\+\_\+raw\+\_\+ell\+\_\+arc}
\item 
struct \textbf{ gad\+\_\+raw\+\_\+ha\+\_\+ell\+\_\+point\+\_\+unc\+\_\+ell}
\item 
struct \textbf{ gad\+\_\+raw\+\_\+ha\+\_\+ell\+\_\+point\+\_\+alt\+\_\+unc\+\_\+ell}
\item 
union \textbf{ gad\+\_\+raw}
\begin{DoxyCompactList}\small\item\em GAD PDU in network-\/byte-\/order according to 3GPP TS 23.\+032 GAD\+: Universal Geographical Area Description. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \textbf{ DEC\+\_\+\+ERR}(RC,  TYPE,  fmt,  args...)
\end{DoxyCompactItemize}
\doxysubsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \textbf{ gad\+\_\+type} \{ \newline
\textbf{ GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT} = 0
, \newline
\textbf{ GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+UNC\+\_\+\+CIRCLE} = 1
, \newline
\textbf{ GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+UNC\+\_\+\+ELLIPSE} = 3
, \newline
\textbf{ GAD\+\_\+\+TYPE\+\_\+\+POLYGON} = 5
, \newline
\textbf{ GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+ALT} = 8
, \newline
\textbf{ GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+ALT\+\_\+\+UNC\+\_\+\+ELL} = 9
, \newline
\textbf{ GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+ARC} = 10
, \newline
\textbf{ GAD\+\_\+\+TYPE\+\_\+\+HA\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+UNC\+\_\+\+ELLIPSE} = 11
, \newline
\textbf{ GAD\+\_\+\+TYPE\+\_\+\+HA\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+ALT\+\_\+\+UNC\+\_\+\+ELL} = 12
 \}
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
static const char $\ast$ \textbf{ osmo\+\_\+gad\+\_\+type\+\_\+name} (enum \textbf{ gad\+\_\+type} val)
\item 
int \textbf{ osmo\+\_\+gad\+\_\+raw\+\_\+write} (struct \textbf{ msgb} $\ast$\textbf{ msg}, const union \textbf{ gad\+\_\+raw} $\ast$\textbf{ gad\+\_\+raw})
\begin{DoxyCompactList}\small\item\em Append a GAD PDU to the msgb. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+gad\+\_\+raw\+\_\+read} (union \textbf{ gad\+\_\+raw} $\ast$\textbf{ gad\+\_\+raw}, struct \textbf{ osmo\+\_\+gad\+\_\+err} $\ast$$\ast$err, void $\ast$err\+\_\+ctx, const uint8\+\_\+t $\ast$\textbf{ data}, uint8\+\_\+t \textbf{ len})
\begin{DoxyCompactList}\small\item\em Read a GAD PDU and validate structure. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+gad\+\_\+enc} (union \textbf{ gad\+\_\+raw} $\ast$\textbf{ gad\+\_\+raw}, const struct \textbf{ osmo\+\_\+gad} $\ast$gad)
\begin{DoxyCompactList}\small\item\em Write GAD values with consistent units to raw GAD PDU representation. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+gad\+\_\+dec} (struct \textbf{ osmo\+\_\+gad} $\ast$gad, struct \textbf{ osmo\+\_\+gad\+\_\+err} $\ast$$\ast$err, void $\ast$err\+\_\+ctx, const union \textbf{ gad\+\_\+raw} $\ast$raw)
\begin{DoxyCompactList}\small\item\em Decode GAD raw PDU to values with consistent units. \end{DoxyCompactList}\item 
int \textbf{ osmo\+\_\+gad\+\_\+to\+\_\+str\+\_\+buf} (char $\ast$buf, size\+\_\+t buflen, const struct \textbf{ osmo\+\_\+gad} $\ast$gad)
\begin{DoxyCompactList}\small\item\em Return a human readable representation of GAD (location estimate) values. \end{DoxyCompactList}\item 
char $\ast$ \textbf{ osmo\+\_\+gad\+\_\+to\+\_\+str\+\_\+c} (void $\ast$ctx, const struct \textbf{ osmo\+\_\+gad} $\ast$gad)
\begin{DoxyCompactList}\small\item\em Return a human readable representation of GAD (location estimate) values. \end{DoxyCompactList}\item 
uint32\+\_\+t \textbf{ osmo\+\_\+gad\+\_\+enc\+\_\+lat} (int32\+\_\+t deg\+\_\+1e6)
\begin{DoxyCompactList}\small\item\em Encode a latitude value according to 3GPP TS 23.\+032. \end{DoxyCompactList}\item 
int32\+\_\+t \textbf{ osmo\+\_\+gad\+\_\+dec\+\_\+lat} (uint32\+\_\+t \textbf{ lat})
\begin{DoxyCompactList}\small\item\em Decode a latitude value according to 3GPP TS 23.\+032. \end{DoxyCompactList}\item 
uint32\+\_\+t \textbf{ osmo\+\_\+gad\+\_\+enc\+\_\+lon} (int32\+\_\+t deg\+\_\+1e6)
\begin{DoxyCompactList}\small\item\em Encode a longitude value according to 3GPP TS 23.\+032. \end{DoxyCompactList}\item 
int32\+\_\+t \textbf{ osmo\+\_\+gad\+\_\+dec\+\_\+lon} (uint32\+\_\+t \textbf{ lon})
\begin{DoxyCompactList}\small\item\em Decode a longitude value according to 3GPP TS 23.\+032. \end{DoxyCompactList}\item 
uint8\+\_\+t \textbf{ osmo\+\_\+gad\+\_\+enc\+\_\+unc} (uint32\+\_\+t mm)
\begin{DoxyCompactList}\small\item\em Encode an uncertainty circle value according to 3GPP TS 23.\+032. \end{DoxyCompactList}\item 
uint32\+\_\+t \textbf{ osmo\+\_\+gad\+\_\+dec\+\_\+unc} (uint8\+\_\+t unc)
\begin{DoxyCompactList}\small\item\em Decode an uncertainty circle value according to 3GPP TS 23.\+032. \end{DoxyCompactList}\item 
struct \textbf{ gad\+\_\+raw\+\_\+head} \textbf{ \+\_\+\+\_\+attribute\+\_\+\+\_\+} ((packed))
\item 
static int \textbf{ osmo\+\_\+gad\+\_\+enc\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle} (struct \textbf{ gad\+\_\+raw\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle} $\ast$raw, const struct \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle} $\ast$v)
\item 
static int \textbf{ osmo\+\_\+gad\+\_\+dec\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle} (struct \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle} $\ast$v, struct \textbf{ osmo\+\_\+gad\+\_\+err} $\ast$$\ast$err, void $\ast$err\+\_\+ctx, const struct \textbf{ gad\+\_\+raw\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle} $\ast$raw)
\item 
static int \textbf{ osmo\+\_\+gad\+\_\+raw\+\_\+len} (const union \textbf{ gad\+\_\+raw} $\ast$\textbf{ gad\+\_\+raw})
\item 
int \textbf{ osmo\+\_\+gad\+\_\+raw\+\_\+to\+\_\+str\+\_\+buf} (char $\ast$buf, size\+\_\+t buflen, const union \textbf{ gad\+\_\+raw} $\ast$raw)
\begin{DoxyCompactList}\small\item\em Return a human readable representation of a raw GAD PDU. \end{DoxyCompactList}\item 
char $\ast$ \textbf{ osmo\+\_\+gad\+\_\+raw\+\_\+to\+\_\+str\+\_\+c} (void $\ast$ctx, const union \textbf{ gad\+\_\+raw} $\ast$raw)
\begin{DoxyCompactList}\small\item\em Return a human readable representation of a raw GAD PDU. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
const struct \textbf{ value\+\_\+string} \textbf{ osmo\+\_\+gad\+\_\+type\+\_\+names} [$\,$]
\item 
const struct \textbf{ value\+\_\+string} \textbf{ osmo\+\_\+gad\+\_\+type\+\_\+names} [$\,$]
\item 
static uint32\+\_\+t \textbf{ table\+\_\+uncertainty\+\_\+1e3} [128]
\item 
enum \textbf{ gsmtap\+\_\+um\+\_\+voice\+\_\+type} \textbf{ \+\_\+\+\_\+attribute\+\_\+\+\_\+}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}


\doxysubsection{Macro Definition Documentation}
\mbox{\label{group__gad_ga4ddac5cb2b43d106cd8c94d9afeb3acc}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!DEC\_ERR@{DEC\_ERR}}
\index{DEC\_ERR@{DEC\_ERR}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{DEC\_ERR}
{\footnotesize\ttfamily \#define DEC\+\_\+\+ERR(\begin{DoxyParamCaption}\item[{}]{RC,  }\item[{}]{TYPE,  }\item[{}]{fmt,  }\item[{}]{args... }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{                \textcolor{keywordflow}{do} \{ \(\backslash\)}
\DoxyCodeLine{                if (err) \{ \(\backslash\)}
\DoxyCodeLine{                        *err = talloc\_zero(err\_ctx, \textcolor{keyword}{struct} osmo\_gad\_err); \(\backslash\)}
\DoxyCodeLine{                        **err = (\textcolor{keyword}{struct }osmo\_gad\_err)\{ \(\backslash\)}
\DoxyCodeLine{                                .rc = (RC), \(\backslash\)}
\DoxyCodeLine{                                .type = (TYPE), \(\backslash\)}
\DoxyCodeLine{                                .logmsg = talloc\_asprintf(*err, \textcolor{stringliteral}{"{}Error decoding GAD\%s\%s: "{}} fmt, \(\backslash\)}
\DoxyCodeLine{                                                          ((\textcolor{keywordtype}{int})(TYPE)) >= 0 ? \textcolor{stringliteral}{"{} "{}} : \textcolor{stringliteral}{"{}"{}}, \(\backslash\)}
\DoxyCodeLine{                                                          ((\textcolor{keywordtype}{int})(TYPE)) >= 0 ? osmo\_gad\_type\_name(TYPE) : \textcolor{stringliteral}{"{}"{}}, \#\#args), \(\backslash\)}
\DoxyCodeLine{                        \}; \(\backslash\)}
\DoxyCodeLine{                \} \(\backslash\)}
\DoxyCodeLine{                return RC; \(\backslash\)}
\DoxyCodeLine{        \} \textcolor{keywordflow}{while}(0)}

\end{DoxyCode}


\doxysubsection{Enumeration Type Documentation}
\mbox{\label{group__gad_ga724072483a2effebff9f40c4fd5b88a8}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!gad\_type@{gad\_type}}
\index{gad\_type@{gad\_type}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{gad\_type}
{\footnotesize\ttfamily enum \textbf{ gad\+\_\+type}}

\begin{DoxyEnumFields}{Enumerator}
\raisebox{\heightof{T}}[0pt][0pt]{\index{GAD\_TYPE\_ELL\_POINT@{GAD\_TYPE\_ELL\_POINT}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!GAD\_TYPE\_ELL\_POINT@{GAD\_TYPE\_ELL\_POINT}}}\mbox{\label{group__gad_gga724072483a2effebff9f40c4fd5b88a8a2cb39492a02a4e0df89150c6685ac59e}} 
GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT&Ellipsoid point. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GAD\_TYPE\_ELL\_POINT\_UNC\_CIRCLE@{GAD\_TYPE\_ELL\_POINT\_UNC\_CIRCLE}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!GAD\_TYPE\_ELL\_POINT\_UNC\_CIRCLE@{GAD\_TYPE\_ELL\_POINT\_UNC\_CIRCLE}}}\mbox{\label{group__gad_gga724072483a2effebff9f40c4fd5b88a8a8742f079b7f515aaaa2f9df8ffb2719a}} 
GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+UNC\+\_\+\+CIRCLE&Ellipsoid point with uncertainty circle. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GAD\_TYPE\_ELL\_POINT\_UNC\_ELLIPSE@{GAD\_TYPE\_ELL\_POINT\_UNC\_ELLIPSE}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!GAD\_TYPE\_ELL\_POINT\_UNC\_ELLIPSE@{GAD\_TYPE\_ELL\_POINT\_UNC\_ELLIPSE}}}\mbox{\label{group__gad_gga724072483a2effebff9f40c4fd5b88a8adf622ab954489f975f7de7e174373e7e}} 
GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+UNC\+\_\+\+ELLIPSE&Ellipsoid point with uncertainty ellipse. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GAD\_TYPE\_POLYGON@{GAD\_TYPE\_POLYGON}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!GAD\_TYPE\_POLYGON@{GAD\_TYPE\_POLYGON}}}\mbox{\label{group__gad_gga724072483a2effebff9f40c4fd5b88a8a1c130fdc6f41f71d91e24c2aaf4dd680}} 
GAD\+\_\+\+TYPE\+\_\+\+POLYGON&\\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GAD\_TYPE\_ELL\_POINT\_ALT@{GAD\_TYPE\_ELL\_POINT\_ALT}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!GAD\_TYPE\_ELL\_POINT\_ALT@{GAD\_TYPE\_ELL\_POINT\_ALT}}}\mbox{\label{group__gad_gga724072483a2effebff9f40c4fd5b88a8a2212d85decf26e565c582ec22d760137}} 
GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+ALT&Ellipsoid point with altitude. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GAD\_TYPE\_ELL\_POINT\_ALT\_UNC\_ELL@{GAD\_TYPE\_ELL\_POINT\_ALT\_UNC\_ELL}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!GAD\_TYPE\_ELL\_POINT\_ALT\_UNC\_ELL@{GAD\_TYPE\_ELL\_POINT\_ALT\_UNC\_ELL}}}\mbox{\label{group__gad_gga724072483a2effebff9f40c4fd5b88a8a742e2400c4d694a02e5c8966c816c1ab}} 
GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+ALT\+\_\+\+UNC\+\_\+\+ELL&Ellipsoid point with altitude and uncertainty ellipsoid. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GAD\_TYPE\_ELL\_ARC@{GAD\_TYPE\_ELL\_ARC}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!GAD\_TYPE\_ELL\_ARC@{GAD\_TYPE\_ELL\_ARC}}}\mbox{\label{group__gad_gga724072483a2effebff9f40c4fd5b88a8af491a2df66762e4d30e338a54b881d3b}} 
GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+ARC&Ellipsoid arc. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GAD\_TYPE\_HA\_ELL\_POINT\_UNC\_ELLIPSE@{GAD\_TYPE\_HA\_ELL\_POINT\_UNC\_ELLIPSE}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!GAD\_TYPE\_HA\_ELL\_POINT\_UNC\_ELLIPSE@{GAD\_TYPE\_HA\_ELL\_POINT\_UNC\_ELLIPSE}}}\mbox{\label{group__gad_gga724072483a2effebff9f40c4fd5b88a8a2719b602e9994a385e525ae3f2c646d9}} 
GAD\+\_\+\+TYPE\+\_\+\+HA\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+UNC\+\_\+\+ELLIPSE&High accuracy ellipsoid point with uncertainty ellipse. \\
\hline

\raisebox{\heightof{T}}[0pt][0pt]{\index{GAD\_TYPE\_HA\_ELL\_POINT\_ALT\_UNC\_ELL@{GAD\_TYPE\_HA\_ELL\_POINT\_ALT\_UNC\_ELL}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!GAD\_TYPE\_HA\_ELL\_POINT\_ALT\_UNC\_ELL@{GAD\_TYPE\_HA\_ELL\_POINT\_ALT\_UNC\_ELL}}}\mbox{\label{group__gad_gga724072483a2effebff9f40c4fd5b88a8acc3691f23c54d4a712f546f210777178}} 
GAD\+\_\+\+TYPE\+\_\+\+HA\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+ALT\+\_\+\+UNC\+\_\+\+ELL&High accuracy ellipsoid point with altitude and uncertainty ellipsoid. \\
\hline

\end{DoxyEnumFields}


\doxysubsection{Function Documentation}
\mbox{\label{group__gad_gae00f0709009b8f66029ea6594a862fe6}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!\_\_attribute\_\_@{\_\_attribute\_\_}}
\index{\_\_attribute\_\_@{\_\_attribute\_\_}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{\_\_attribute\_\_()}
{\footnotesize\ttfamily struct \textbf{ gad\+\_\+raw\+\_\+head} \+\_\+\+\_\+attribute\+\_\+\+\_\+ (\begin{DoxyParamCaption}\item[{(packed)}]{ }\end{DoxyParamCaption})}

\mbox{\label{group__gad_ga686bb6365093dd503b0b9a7f4466b47a}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_dec@{osmo\_gad\_dec}}
\index{osmo\_gad\_dec@{osmo\_gad\_dec}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_dec()}
{\footnotesize\ttfamily int osmo\+\_\+gad\+\_\+dec (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+gad} $\ast$}]{gad,  }\item[{struct \textbf{ osmo\+\_\+gad\+\_\+err} $\ast$$\ast$}]{err,  }\item[{void $\ast$}]{err\+\_\+ctx,  }\item[{const union \textbf{ gad\+\_\+raw} $\ast$}]{raw }\end{DoxyParamCaption})}



Decode GAD raw PDU to values with consistent units. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em gad} & Decoded GAD values are written here. \\
\hline
\mbox{\texttt{ out}}  & {\em err} & Returned pointer to error info, dynamically allocated; NULL to not return any. \\
\hline
\mbox{\texttt{ in}}  & {\em err\+\_\+ctx} & Talloc context to allocate err from, if required. \\
\hline
\mbox{\texttt{ in}}  & {\em raw} & Raw GAD data in network-\/byte-\/order. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, negative on error. If returning negative and err was non-\/\+NULL, $\ast$err is guaranteed to point to an allocated struct \doxyref{osmo\+\_\+gad\+\_\+err}{p.}{structosmo__gad__err}. 
\end{DoxyReturn}


References \textbf{ DEC\+\_\+\+ERR}, \textbf{ osmo\+\_\+gad\+::ell\+\_\+point\+\_\+unc\+\_\+circle}, \textbf{ gad\+\_\+raw\+::ell\+\_\+point\+\_\+unc\+\_\+circle}, \textbf{ ENOTSUP}, \textbf{ GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+UNC\+\_\+\+CIRCLE}, \textbf{ gad\+\_\+raw\+::h}, \textbf{ osmo\+\_\+gad\+\_\+dec\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle()}, and \textbf{ osmo\+\_\+gad\+::type}.



Referenced by \textbf{ osmo\+\_\+gad\+\_\+raw\+\_\+to\+\_\+str\+\_\+buf()}.

\mbox{\label{group__gad_ga52b9373ff6f1ce71a088094d49f252fa}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_dec\_ell\_point\_unc\_circle@{osmo\_gad\_dec\_ell\_point\_unc\_circle}}
\index{osmo\_gad\_dec\_ell\_point\_unc\_circle@{osmo\_gad\_dec\_ell\_point\_unc\_circle}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_dec\_ell\_point\_unc\_circle()}
{\footnotesize\ttfamily static int osmo\+\_\+gad\+\_\+dec\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle (\begin{DoxyParamCaption}\item[{struct \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle} $\ast$}]{v,  }\item[{struct \textbf{ osmo\+\_\+gad\+\_\+err} $\ast$$\ast$}]{err,  }\item[{void $\ast$}]{err\+\_\+ctx,  }\item[{const struct \textbf{ gad\+\_\+raw\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle} $\ast$}]{raw }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ DEC\+\_\+\+ERR}, \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle\+::lat}, \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle\+::lon}, \textbf{ osmo\+\_\+gad\+\_\+dec\+\_\+lat()}, \textbf{ osmo\+\_\+gad\+\_\+dec\+\_\+lon()}, \textbf{ osmo\+\_\+gad\+\_\+dec\+\_\+unc()}, and \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle\+::unc}.



Referenced by \textbf{ osmo\+\_\+gad\+\_\+dec()}.

\mbox{\label{group__gad_gaac3dce106167891a6fbee115f1e2361b}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_dec\_lat@{osmo\_gad\_dec\_lat}}
\index{osmo\_gad\_dec\_lat@{osmo\_gad\_dec\_lat}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_dec\_lat()}
{\footnotesize\ttfamily int32\+\_\+t osmo\+\_\+gad\+\_\+dec\+\_\+lat (\begin{DoxyParamCaption}\item[{uint32\+\_\+t}]{lat }\end{DoxyParamCaption})}



Decode a latitude value according to 3GPP TS 23.\+032. 

Useful to clamp a latitude to an actually encodable accuracy\+: set\+\_\+lat = osmo\+\_\+gad\+\_\+dec\+\_\+lat(osmo\+\_\+gad\+\_\+enc\+\_\+lat(orig\+\_\+lat)); 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em lat} & encoded latitude in host-\/byte-\/order (24bit). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
decoded latitude in micro degrees (degrees $\ast$ 1e6), -\/90\textquotesingle{}000\textquotesingle{}000 (S) .. 90\textquotesingle{}000\textquotesingle{}000 (N). 
\end{DoxyReturn}


References \textbf{ lat}, and \textbf{ x}.



Referenced by \textbf{ osmo\+\_\+gad\+\_\+dec\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle()}.

\mbox{\label{group__gad_ga1758a7bfe8ae598c526a12bd8de00cf1}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_dec\_lon@{osmo\_gad\_dec\_lon}}
\index{osmo\_gad\_dec\_lon@{osmo\_gad\_dec\_lon}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_dec\_lon()}
{\footnotesize\ttfamily int32\+\_\+t osmo\+\_\+gad\+\_\+dec\+\_\+lon (\begin{DoxyParamCaption}\item[{uint32\+\_\+t}]{lon }\end{DoxyParamCaption})}



Decode a longitude value according to 3GPP TS 23.\+032. 

Normally, encoding and decoding is done via \doxyref{osmo\+\_\+gad\+\_\+enc()}{p.}{group__gad_ga1fa7c132fedbc2750d2dc8e8efcee97b} and \doxyref{osmo\+\_\+gad\+\_\+dec()}{p.}{group__gad_ga686bb6365093dd503b0b9a7f4466b47a} for entire PDUs. But calling this directly can be useful to clamp a longitude to an actually encodable accuracy\+: int32\+\_\+t set\+\_\+lon = osmo\+\_\+gad\+\_\+dec\+\_\+lon(osmo\+\_\+gad\+\_\+enc\+\_\+lon(orig\+\_\+lon)); 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em lon} & Encoded longitude. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Longitude in micro degrees (degrees $\ast$ 1e6), -\/180\textquotesingle{}000\textquotesingle{}000 (W) .. 180\textquotesingle{}000\textquotesingle{}000 (E). 
\end{DoxyReturn}


References \textbf{ lon}, and \textbf{ x}.



Referenced by \textbf{ osmo\+\_\+gad\+\_\+dec\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle()}.

\mbox{\label{group__gad_ga29e58d3bbd52a7688bd3b4be4c516e0a}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_dec\_unc@{osmo\_gad\_dec\_unc}}
\index{osmo\_gad\_dec\_unc@{osmo\_gad\_dec\_unc}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_dec\_unc()}
{\footnotesize\ttfamily uint32\+\_\+t osmo\+\_\+gad\+\_\+dec\+\_\+unc (\begin{DoxyParamCaption}\item[{uint8\+\_\+t}]{unc }\end{DoxyParamCaption})}



Decode an uncertainty circle value according to 3GPP TS 23.\+032. 

Useful to clamp a value to an actually encodable accuracy\+: set\+\_\+unc = osmo\+\_\+gad\+\_\+dec\+\_\+unc(osmo\+\_\+gad\+\_\+enc\+\_\+unc(orig\+\_\+unc)); 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em unc} & Encoded uncertainty value. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Uncertainty value in millimeters. 
\end{DoxyReturn}


References \textbf{ table\+\_\+uncertainty\+\_\+1e3}.



Referenced by \textbf{ osmo\+\_\+gad\+\_\+dec\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle()}.

\mbox{\label{group__gad_ga1fa7c132fedbc2750d2dc8e8efcee97b}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_enc@{osmo\_gad\_enc}}
\index{osmo\_gad\_enc@{osmo\_gad\_enc}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_enc()}
{\footnotesize\ttfamily int osmo\+\_\+gad\+\_\+enc (\begin{DoxyParamCaption}\item[{union \textbf{ gad\+\_\+raw} $\ast$}]{gad\+\_\+raw,  }\item[{const struct \textbf{ osmo\+\_\+gad} $\ast$}]{gad }\end{DoxyParamCaption})}



Write GAD values with consistent units to raw GAD PDU representation. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em \doxyref{gad\+\_\+raw}{p.}{uniongad__raw}} & Write to this buffer. \\
\hline
\mbox{\texttt{ in}}  & {\em gad} & GAD values to encode. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of bytes written, or negative on failure. 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+gad\+::ell\+\_\+point\+\_\+unc\+\_\+circle}, \textbf{ gad\+\_\+raw\+::ell\+\_\+point\+\_\+unc\+\_\+circle}, \textbf{ ENOTSUP}, \textbf{ GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+UNC\+\_\+\+CIRCLE}, \textbf{ osmo\+\_\+gad\+\_\+enc\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle()}, and \textbf{ osmo\+\_\+gad\+::type}.

\mbox{\label{group__gad_ga1556c8b17c3abbbddb0f0975c4f737b3}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_enc\_ell\_point\_unc\_circle@{osmo\_gad\_enc\_ell\_point\_unc\_circle}}
\index{osmo\_gad\_enc\_ell\_point\_unc\_circle@{osmo\_gad\_enc\_ell\_point\_unc\_circle}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_enc\_ell\_point\_unc\_circle()}
{\footnotesize\ttfamily static int osmo\+\_\+gad\+\_\+enc\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle (\begin{DoxyParamCaption}\item[{struct \textbf{ gad\+\_\+raw\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle} $\ast$}]{raw,  }\item[{const struct \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle} $\ast$}]{v }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+UNC\+\_\+\+CIRCLE}, \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle\+::lat}, \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle\+::lon}, \textbf{ osmo\+\_\+gad\+\_\+enc\+\_\+lat()}, \textbf{ osmo\+\_\+gad\+\_\+enc\+\_\+lon()}, \textbf{ osmo\+\_\+gad\+\_\+enc\+\_\+unc()}, and \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle\+::unc}.



Referenced by \textbf{ osmo\+\_\+gad\+\_\+enc()}.

\mbox{\label{group__gad_ga0f17993e638716d8f3837c004302b4a7}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_enc\_lat@{osmo\_gad\_enc\_lat}}
\index{osmo\_gad\_enc\_lat@{osmo\_gad\_enc\_lat}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_enc\_lat()}
{\footnotesize\ttfamily uint32\+\_\+t osmo\+\_\+gad\+\_\+enc\+\_\+lat (\begin{DoxyParamCaption}\item[{int32\+\_\+t}]{deg\+\_\+1e6 }\end{DoxyParamCaption})}



Encode a latitude value according to 3GPP TS 23.\+032. 

Useful to clamp a latitude to an actually encodable accuracy\+: set\+\_\+lat = osmo\+\_\+gad\+\_\+dec\+\_\+lat(osmo\+\_\+gad\+\_\+enc\+\_\+lat(orig\+\_\+lat)); 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em deg\+\_\+1e6} & Latitude in micro degrees (degrees $\ast$ 1e6), -\/90\textquotesingle{}000\textquotesingle{}000 (S) .. 90\textquotesingle{}000\textquotesingle{}000 (N). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
encoded latitude in host-\/byte-\/order (24bit). 
\end{DoxyReturn}


References \textbf{ OSMO\+\_\+\+MAX}, \textbf{ OSMO\+\_\+\+MIN}, and \textbf{ x}.



Referenced by \textbf{ osmo\+\_\+gad\+\_\+enc\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle()}.

\mbox{\label{group__gad_gaa26b905a22d6e0cb4bde8aaf0fd8d2c0}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_enc\_lon@{osmo\_gad\_enc\_lon}}
\index{osmo\_gad\_enc\_lon@{osmo\_gad\_enc\_lon}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_enc\_lon()}
{\footnotesize\ttfamily uint32\+\_\+t osmo\+\_\+gad\+\_\+enc\+\_\+lon (\begin{DoxyParamCaption}\item[{int32\+\_\+t}]{deg\+\_\+1e6 }\end{DoxyParamCaption})}



Encode a longitude value according to 3GPP TS 23.\+032. 

Useful to clamp a longitude to an actually encodable accuracy\+: set\+\_\+lon = osmo\+\_\+gad\+\_\+dec\+\_\+lon(osmo\+\_\+gad\+\_\+enc\+\_\+lon(orig\+\_\+lon)); 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em deg\+\_\+1e6} & Longitude in micro degrees (degrees $\ast$ 1e6), -\/180\textquotesingle{}000\textquotesingle{}000 (W) .. 180\textquotesingle{}000\textquotesingle{}000 (E). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
encoded longitude in host-\/byte-\/order (24bit). 
\end{DoxyReturn}


References \textbf{ OSMO\+\_\+\+MAX}, \textbf{ OSMO\+\_\+\+MIN}, and \textbf{ x}.



Referenced by \textbf{ osmo\+\_\+gad\+\_\+enc\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle()}.

\mbox{\label{group__gad_ga985256af8e39b55f74ecae46f7cec120}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_enc\_unc@{osmo\_gad\_enc\_unc}}
\index{osmo\_gad\_enc\_unc@{osmo\_gad\_enc\_unc}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_enc\_unc()}
{\footnotesize\ttfamily uint8\+\_\+t osmo\+\_\+gad\+\_\+enc\+\_\+unc (\begin{DoxyParamCaption}\item[{uint32\+\_\+t}]{mm }\end{DoxyParamCaption})}



Encode an uncertainty circle value according to 3GPP TS 23.\+032. 

Normally, encoding and decoding is done via \doxyref{osmo\+\_\+gad\+\_\+enc()}{p.}{group__gad_ga1fa7c132fedbc2750d2dc8e8efcee97b} and \doxyref{osmo\+\_\+gad\+\_\+dec()}{p.}{group__gad_ga686bb6365093dd503b0b9a7f4466b47a} for entire PDUs. But calling this directly can be useful to clamp a value to an actually encodable accuracy\+: uint32\+\_\+t set\+\_\+unc = osmo\+\_\+gad\+\_\+dec\+\_\+unc(osmo\+\_\+gad\+\_\+enc\+\_\+unc(orig\+\_\+unc)); 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em mm} & Uncertainty value in millimeters. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Encoded uncertainty value. 
\end{DoxyReturn}


References \textbf{ ARRAY\+\_\+\+SIZE}, and \textbf{ table\+\_\+uncertainty\+\_\+1e3}.



Referenced by \textbf{ osmo\+\_\+gad\+\_\+enc\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle()}.

\mbox{\label{group__gad_ga7be8ec6eb0e09665907bca2c8d54c97c}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_raw\_len@{osmo\_gad\_raw\_len}}
\index{osmo\_gad\_raw\_len@{osmo\_gad\_raw\_len}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_raw\_len()}
{\footnotesize\ttfamily static int osmo\+\_\+gad\+\_\+raw\+\_\+len (\begin{DoxyParamCaption}\item[{const union \textbf{ gad\+\_\+raw} $\ast$}]{gad\+\_\+raw }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



References \textbf{ gad\+\_\+raw\+::ell\+\_\+arc}, \textbf{ gad\+\_\+raw\+::ell\+\_\+point}, \textbf{ gad\+\_\+raw\+::ell\+\_\+point\+\_\+alt}, \textbf{ gad\+\_\+raw\+::ell\+\_\+point\+\_\+alt\+\_\+unc\+\_\+ell}, \textbf{ gad\+\_\+raw\+::ell\+\_\+point\+\_\+unc\+\_\+circle}, \textbf{ gad\+\_\+raw\+::ell\+\_\+point\+\_\+unc\+\_\+ellipse}, \textbf{ ENOTSUP}, \textbf{ GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+ARC}, \textbf{ GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT}, \textbf{ GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+ALT}, \textbf{ GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+ALT\+\_\+\+UNC\+\_\+\+ELL}, \textbf{ GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+UNC\+\_\+\+CIRCLE}, \textbf{ GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+UNC\+\_\+\+ELLIPSE}, \textbf{ GAD\+\_\+\+TYPE\+\_\+\+HA\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+ALT\+\_\+\+UNC\+\_\+\+ELL}, \textbf{ GAD\+\_\+\+TYPE\+\_\+\+HA\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+UNC\+\_\+\+ELLIPSE}, \textbf{ GAD\+\_\+\+TYPE\+\_\+\+POLYGON}, \textbf{ gad\+\_\+raw\+\_\+polygon\+::h}, \textbf{ gad\+\_\+raw\+::h}, \textbf{ gad\+\_\+raw\+::ha\+\_\+ell\+\_\+point\+\_\+alt\+\_\+unc\+\_\+ell}, \textbf{ gad\+\_\+raw\+::ha\+\_\+ell\+\_\+point\+\_\+unc\+\_\+ell}, \textbf{ gad\+\_\+raw\+\_\+polygon\+::point}, and \textbf{ gad\+\_\+raw\+::polygon}.



Referenced by \textbf{ osmo\+\_\+gad\+\_\+raw\+\_\+read()}, and \textbf{ osmo\+\_\+gad\+\_\+raw\+\_\+write()}.

\mbox{\label{group__gad_ga7a8fcfeca1ed42d611ed16acda7fa337}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_raw\_read@{osmo\_gad\_raw\_read}}
\index{osmo\_gad\_raw\_read@{osmo\_gad\_raw\_read}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_raw\_read()}
{\footnotesize\ttfamily int osmo\+\_\+gad\+\_\+raw\+\_\+read (\begin{DoxyParamCaption}\item[{union \textbf{ gad\+\_\+raw} $\ast$}]{gad\+\_\+raw,  }\item[{struct \textbf{ osmo\+\_\+gad\+\_\+err} $\ast$$\ast$}]{err,  }\item[{void $\ast$}]{err\+\_\+ctx,  }\item[{const uint8\+\_\+t $\ast$}]{data,  }\item[{uint8\+\_\+t}]{len }\end{DoxyParamCaption})}



Read a GAD PDU and validate structure. 

Memcpy from data to \doxyref{gad\+\_\+raw}{p.}{uniongad__raw} struct, and validate correct length depending on the GAD type and possibly on variable length attributes. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em \doxyref{gad\+\_\+raw}{p.}{uniongad__raw}} & Copy GAD PDU here. \\
\hline
\mbox{\texttt{ out}}  & {\em err} & Returned pointer to error info, dynamically allocated; NULL to not return any. \\
\hline
\mbox{\texttt{ in}}  & {\em err\+\_\+ctx} & Talloc context to allocate err from, if required. \\
\hline
\mbox{\texttt{ in}}  & {\em data} & Encoded GAD bytes buffer. \\
\hline
\mbox{\texttt{ in}}  & {\em len} & Length of data in bytes. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, negative on error. If returning negative and err was non-\/\+NULL, $\ast$err is guaranteed to point to an allocated struct \doxyref{osmo\+\_\+gad\+\_\+err}{p.}{structosmo__gad__err}. 
\end{DoxyReturn}


References \textbf{ data}, \textbf{ DEC\+\_\+\+ERR}, \textbf{ gad\+\_\+raw\+::h}, \textbf{ len}, and \textbf{ osmo\+\_\+gad\+\_\+raw\+\_\+len()}.



Referenced by \textbf{ osmo\+\_\+bssmap\+\_\+le\+\_\+ie\+\_\+dec\+\_\+gad()}.

\mbox{\label{group__gad_ga7a5e93dc799c5243d3deb3b9ca5cfccc}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_raw\_to\_str\_buf@{osmo\_gad\_raw\_to\_str\_buf}}
\index{osmo\_gad\_raw\_to\_str\_buf@{osmo\_gad\_raw\_to\_str\_buf}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_raw\_to\_str\_buf()}
{\footnotesize\ttfamily int osmo\+\_\+gad\+\_\+raw\+\_\+to\+\_\+str\+\_\+buf (\begin{DoxyParamCaption}\item[{char $\ast$}]{buf,  }\item[{size\+\_\+t}]{buflen,  }\item[{const union \textbf{ gad\+\_\+raw} $\ast$}]{raw }\end{DoxyParamCaption})}



Return a human readable representation of a raw GAD PDU. 

Convert to GAD values and feed the result to \doxyref{osmo\+\_\+gad\+\_\+to\+\_\+str\+\_\+buf()}{p.}{group__gad_gafba7be63d8f3f677ca51eb021dfac63e}. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em buf} & Buffer to write string to. \\
\hline
\mbox{\texttt{ in}}  & {\em buflen} & sizeof(buf). \\
\hline
\mbox{\texttt{ in}}  & {\em gad} & Location data. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of chars that would be written, like snprintf(). 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+strbuf\+::buf}, \textbf{ osmo\+\_\+strbuf\+::chars\+\_\+needed}, \textbf{ osmo\+\_\+gad\+\_\+dec()}, \textbf{ osmo\+\_\+gad\+\_\+to\+\_\+str\+\_\+buf()}, and \textbf{ OSMO\+\_\+\+STRBUF\+\_\+\+PRINTF}.



Referenced by \textbf{ osmo\+\_\+gad\+\_\+raw\+\_\+to\+\_\+str\+\_\+c()}.

\mbox{\label{group__gad_ga9ea8aeeda73e9259735dc24855b0c320}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_raw\_to\_str\_c@{osmo\_gad\_raw\_to\_str\_c}}
\index{osmo\_gad\_raw\_to\_str\_c@{osmo\_gad\_raw\_to\_str\_c}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_raw\_to\_str\_c()}
{\footnotesize\ttfamily char $\ast$ osmo\+\_\+gad\+\_\+raw\+\_\+to\+\_\+str\+\_\+c (\begin{DoxyParamCaption}\item[{void $\ast$}]{ctx,  }\item[{const union \textbf{ gad\+\_\+raw} $\ast$}]{raw }\end{DoxyParamCaption})}



Return a human readable representation of a raw GAD PDU. 

Convert to GAD values and feed the result to \doxyref{osmo\+\_\+gad\+\_\+to\+\_\+str\+\_\+buf()}{p.}{group__gad_gafba7be63d8f3f677ca51eb021dfac63e}. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em ctx} & Talloc ctx to allocate string buffer from. \\
\hline
\mbox{\texttt{ in}}  & {\em raw} & GAD data in network-\/byte-\/order. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
resulting string, dynamically allocated. 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+gad\+\_\+raw\+\_\+to\+\_\+str\+\_\+buf()}, and \textbf{ OSMO\+\_\+\+NAME\+\_\+\+C\+\_\+\+IMPL}.

\mbox{\label{group__gad_gaeceb8523f03a150296244463444f73a2}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_raw\_write@{osmo\_gad\_raw\_write}}
\index{osmo\_gad\_raw\_write@{osmo\_gad\_raw\_write}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_raw\_write()}
{\footnotesize\ttfamily int osmo\+\_\+gad\+\_\+raw\+\_\+write (\begin{DoxyParamCaption}\item[{struct \textbf{ msgb} $\ast$}]{msg,  }\item[{const union \textbf{ gad\+\_\+raw} $\ast$}]{gad\+\_\+raw }\end{DoxyParamCaption})}



Append a GAD PDU to the msgb. 

Write the correct number of bytes depending on the GAD type and possibly on variable length attributes. 
\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em msg} & Append to this msgb. \\
\hline
\mbox{\texttt{ in}}  & {\em \doxyref{gad\+\_\+raw}{p.}{uniongad__raw}} & GAD data to write. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of bytes appended to msgb, or negative on failure. 
\end{DoxyReturn}


References \textbf{ len}, \textbf{ msg}, \textbf{ msgb\+\_\+put()}, and \textbf{ osmo\+\_\+gad\+\_\+raw\+\_\+len()}.



Referenced by \textbf{ gsm0808\+\_\+create\+\_\+perform\+\_\+location\+\_\+response()}, and \textbf{ osmo\+\_\+bssmap\+\_\+le\+\_\+enc\+\_\+perform\+\_\+loc\+\_\+resp()}.

\mbox{\label{group__gad_gafba7be63d8f3f677ca51eb021dfac63e}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_to\_str\_buf@{osmo\_gad\_to\_str\_buf}}
\index{osmo\_gad\_to\_str\_buf@{osmo\_gad\_to\_str\_buf}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_to\_str\_buf()}
{\footnotesize\ttfamily int osmo\+\_\+gad\+\_\+to\+\_\+str\+\_\+buf (\begin{DoxyParamCaption}\item[{char $\ast$}]{buf,  }\item[{size\+\_\+t}]{buflen,  }\item[{const struct \textbf{ osmo\+\_\+gad} $\ast$}]{gad }\end{DoxyParamCaption})}



Return a human readable representation of GAD (location estimate) values. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ out}}  & {\em buf} & Buffer to write string to. \\
\hline
\mbox{\texttt{ in}}  & {\em buflen} & sizeof(buf). \\
\hline
\mbox{\texttt{ in}}  & {\em gad} & Location data. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
number of chars that would be written, like snprintf(). 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+strbuf\+::buf}, \textbf{ osmo\+\_\+strbuf\+::chars\+\_\+needed}, \textbf{ osmo\+\_\+gad\+::ell\+\_\+point}, \textbf{ osmo\+\_\+gad\+::ell\+\_\+point\+\_\+unc\+\_\+circle}, \textbf{ GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT}, \textbf{ GAD\+\_\+\+TYPE\+\_\+\+ELL\+\_\+\+POINT\+\_\+\+UNC\+\_\+\+CIRCLE}, \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point\+::lat}, \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle\+::lat}, \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point\+::lon}, \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle\+::lon}, \textbf{ osmo\+\_\+gad\+\_\+type\+\_\+name()}, \textbf{ osmo\+\_\+int\+\_\+to\+\_\+float\+\_\+str\+\_\+buf()}, \textbf{ OSMO\+\_\+\+STRBUF\+\_\+\+APPEND}, \textbf{ OSMO\+\_\+\+STRBUF\+\_\+\+PRINTF}, \textbf{ osmo\+\_\+gad\+::type}, and \textbf{ osmo\+\_\+gad\+\_\+ell\+\_\+point\+\_\+unc\+\_\+circle\+::unc}.



Referenced by \textbf{ osmo\+\_\+gad\+\_\+raw\+\_\+to\+\_\+str\+\_\+buf()}, and \textbf{ osmo\+\_\+gad\+\_\+to\+\_\+str\+\_\+c()}.

\mbox{\label{group__gad_gaf162470afdd796be9084ddad25f67cc3}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_to\_str\_c@{osmo\_gad\_to\_str\_c}}
\index{osmo\_gad\_to\_str\_c@{osmo\_gad\_to\_str\_c}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_to\_str\_c()}
{\footnotesize\ttfamily char $\ast$ osmo\+\_\+gad\+\_\+to\+\_\+str\+\_\+c (\begin{DoxyParamCaption}\item[{void $\ast$}]{ctx,  }\item[{const struct \textbf{ osmo\+\_\+gad} $\ast$}]{gad }\end{DoxyParamCaption})}



Return a human readable representation of GAD (location estimate) values. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em ctx} & Talloc ctx to allocate string buffer from. \\
\hline
\mbox{\texttt{ in}}  & {\em val} & Value to convert to float. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
resulting string, dynamically allocated. 
\end{DoxyReturn}


References \textbf{ osmo\+\_\+gad\+\_\+to\+\_\+str\+\_\+buf()}, and \textbf{ OSMO\+\_\+\+NAME\+\_\+\+C\+\_\+\+IMPL}.

\mbox{\label{group__gad_gaf25259c4be18d6d03a28f46cf26d810a}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_type\_name@{osmo\_gad\_type\_name}}
\index{osmo\_gad\_type\_name@{osmo\_gad\_type\_name}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_type\_name()}
{\footnotesize\ttfamily static const char $\ast$ osmo\+\_\+gad\+\_\+type\+\_\+name (\begin{DoxyParamCaption}\item[{enum \textbf{ gad\+\_\+type}}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}, {\ttfamily [static]}}



References \textbf{ get\+\_\+value\+\_\+string()}, and \textbf{ osmo\+\_\+gad\+\_\+type\+\_\+names}.



Referenced by \textbf{ osmo\+\_\+gad\+\_\+to\+\_\+str\+\_\+buf()}.



\doxysubsection{Variable Documentation}
\mbox{\label{group__gad_gae02bf39f68ae57e2bc44458feb80d14b}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_type\_names@{osmo\_gad\_type\_names}}
\index{osmo\_gad\_type\_names@{osmo\_gad\_type\_names}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_type\_names\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily const struct \textbf{ value\+\_\+string} osmo\+\_\+gad\+\_\+type\+\_\+names[$\,$]\hspace{0.3cm}{\ttfamily [extern]}}



Referenced by \textbf{ osmo\+\_\+gad\+\_\+type\+\_\+name()}.

\mbox{\label{group__gad_gae02bf39f68ae57e2bc44458feb80d14b}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!osmo\_gad\_type\_names@{osmo\_gad\_type\_names}}
\index{osmo\_gad\_type\_names@{osmo\_gad\_type\_names}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{osmo\_gad\_type\_names\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily const struct \textbf{ value\+\_\+string} osmo\+\_\+gad\+\_\+type\+\_\+names[$\,$]}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        \{ GAD\_TYPE\_ELL\_POINT, \textcolor{stringliteral}{"{}Ellipsoid-\/point"{}} \},}
\DoxyCodeLine{        \{ GAD\_TYPE\_ELL\_POINT\_UNC\_CIRCLE, \textcolor{stringliteral}{"{}Ellipsoid-\/point-\/with-\/uncertainty-\/circle"{}} \},}
\DoxyCodeLine{        \{ GAD\_TYPE\_ELL\_POINT\_UNC\_ELLIPSE, \textcolor{stringliteral}{"{}Ellipsoid-\/point-\/with-\/uncertainty-\/ellipse"{}} \},}
\DoxyCodeLine{        \{ GAD\_TYPE\_POLYGON, \textcolor{stringliteral}{"{}Polygon"{}} \},}
\DoxyCodeLine{        \{ GAD\_TYPE\_ELL\_POINT\_ALT, \textcolor{stringliteral}{"{}Ellipsoid-\/point-\/with-\/altitude"{}} \},}
\DoxyCodeLine{        \{ GAD\_TYPE\_ELL\_POINT\_ALT\_UNC\_ELL, \textcolor{stringliteral}{"{}Ellipsoid-\/point-\/with-\/altitude-\/and-\/uncertainty-\/ellipsoid"{}} \},}
\DoxyCodeLine{        \{ GAD\_TYPE\_ELL\_ARC, \textcolor{stringliteral}{"{}Ellipsoid-\/arc"{}} \},}
\DoxyCodeLine{        \{ GAD\_TYPE\_HA\_ELL\_POINT\_UNC\_ELLIPSE, \textcolor{stringliteral}{"{}High-\/accuracy-\/ellipsoid-\/point-\/with-\/uncertainty-\/ellipse"{}} \},}
\DoxyCodeLine{        \{ GAD\_TYPE\_HA\_ELL\_POINT\_ALT\_UNC\_ELL, \textcolor{stringliteral}{"{}High-\/accuracy-\/ellipsoid-\/point-\/with-\/altitude-\/and-\/uncertainty-\/ellipsoid"{}} \},}
\DoxyCodeLine{        \{\}}
\DoxyCodeLine{\}}

\end{DoxyCode}


Referenced by \textbf{ osmo\+\_\+gad\+\_\+type\+\_\+name()}.

\mbox{\label{group__gad_ga27653fcc2e81df69254e5d71b375936f}} 
\index{3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}!table\_uncertainty\_1e3@{table\_uncertainty\_1e3}}
\index{table\_uncertainty\_1e3@{table\_uncertainty\_1e3}!3GPP TS 23.032 GAD: Universal Geographical Area Description.@{3GPP TS 23.032 GAD: Universal Geographical Area Description.}}
\doxysubsubsection{table\_uncertainty\_1e3}
{\footnotesize\ttfamily uint32\+\_\+t table\+\_\+uncertainty\+\_\+1e3[128]\hspace{0.3cm}{\ttfamily [static]}}

{\bfseries Initial value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{= \{}
\DoxyCodeLine{        0, 1000, 2100, 3310, 4641, 6105, 7715, 9487, 11435, 13579, 15937, 18531, 21384, 24522, 27974, 31772, 35949,}
\DoxyCodeLine{        40544, 45599, 51159, 57274, 64002, 71402, 79543, 88497, 98347, 109181, 121099, 134209, 148630, 164494, 181943,}
\DoxyCodeLine{        201137, 222251, 245476, 271024, 299126, 330039, 364043, 401447, 442592, 487851, 537636, 592400, 652640, 718904,}
\DoxyCodeLine{        791795, 871974, 960172, 1057189, 1163908, 1281299, 1410429, 1552472, 1708719, 1880591, 2069650, 2277615,}
\DoxyCodeLine{        2506377, 2758014, 3034816, 3339298, 3674227, 4042650, 4447915, 4893707, 5384077, 5923485, 6516834, 7169517,}
\DoxyCodeLine{        7887469, 8677216, 9545938, 10501531, 11552685, 12708953, 13980849, 15379933, 16918927, 18611820, 20474002,}
\DoxyCodeLine{        22522402, 24775642, 27254206, 29980627, 32979690, 36278659, 39907525, 43899277, 48290205, 53120226, 58433248,}
\DoxyCodeLine{        64277573, 70706330, 77777964, 85556760, 94113436, 103525780, 113879358, 125268293, 137796123, 151576735,}
\DoxyCodeLine{        166735409, 183409950, 201751945, 221928139, 244121953, 268535149, 295389664, 324929630, 357423593, 393166952,}
\DoxyCodeLine{        432484648, 475734112, 523308524, 575640376, 633205414, 696526955, 766180651, 842799716, 927080688, 1019789756,}
\DoxyCodeLine{        1121769732, 1233947705, 1357343476, 1493078824, 1642387706, 1806627477,}
\DoxyCodeLine{\}}

\end{DoxyCode}


Referenced by \textbf{ osmo\+\_\+gad\+\_\+dec\+\_\+unc()}, and \textbf{ osmo\+\_\+gad\+\_\+enc\+\_\+unc()}.

