\doxysection{include/osmocom/gsm/gad.h File Reference}
\label{gad_8h}\index{include/osmocom/gsm/gad.h@{include/osmocom/gsm/gad.h}}


Message encoding and decoding for 3GPP TS 23.\+032 GAD\+: Universal Geographical Area Description.  


{\ttfamily \#include $<$osmocom/gsm/protocol/gsm\+\_\+23\+\_\+032.\+h$>$}\newline
{\ttfamily \#include $<$osmocom/core/utils.\+h$>$}\newline
\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}
\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}\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
const struct \textbf{ value\+\_\+string} \textbf{ osmo\+\_\+gad\+\_\+type\+\_\+names} [$\,$]
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Message encoding and decoding for 3GPP TS 23.\+032 GAD\+: Universal Geographical Area Description. 

