\doxysection{gad.\+h}
\label{gad_8h_source}\index{include/osmocom/gsm/gad.h@{include/osmocom/gsm/gad.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }
\DoxyCodeLine{6 \textcolor{comment}{/*}}
\DoxyCodeLine{7 \textcolor{comment}{ * (C) 2020 by sysmocom -\/ s.f.m.c. GmbH <info@sysmocom.de>}}
\DoxyCodeLine{8 \textcolor{comment}{ *}}
\DoxyCodeLine{9 \textcolor{comment}{ * All Rights Reserved}}
\DoxyCodeLine{10 \textcolor{comment}{ *}}
\DoxyCodeLine{11 \textcolor{comment}{ * Author: Neels Hofmeyr <neels@hofmeyr.de>}}
\DoxyCodeLine{12 \textcolor{comment}{ *}}
\DoxyCodeLine{13 \textcolor{comment}{ * This program is free software; you can redistribute it and/or modify}}
\DoxyCodeLine{14 \textcolor{comment}{ * it under the terms of the GNU Affero General Public License as published by}}
\DoxyCodeLine{15 \textcolor{comment}{ * the Free Software Foundation; either version 3 of the License, or}}
\DoxyCodeLine{16 \textcolor{comment}{ * (at your option) any later version.}}
\DoxyCodeLine{17 \textcolor{comment}{ *}}
\DoxyCodeLine{18 \textcolor{comment}{ * This program is distributed in the hope that it will be useful,}}
\DoxyCodeLine{19 \textcolor{comment}{ * but WITHOUT ANY WARRANTY; without even the implied warranty of}}
\DoxyCodeLine{20 \textcolor{comment}{ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the}}
\DoxyCodeLine{21 \textcolor{comment}{ * GNU Affero General Public License for more details.}}
\DoxyCodeLine{22 \textcolor{comment}{ *}}
\DoxyCodeLine{23 \textcolor{comment}{ * You should have received a copy of the GNU Affero General Public License}}
\DoxyCodeLine{24 \textcolor{comment}{ * along with this program.  If not, see <http://www.gnu.org/licenses/>.}}
\DoxyCodeLine{25 \textcolor{comment}{ *}}
\DoxyCodeLine{26 \textcolor{comment}{ */}}
\DoxyCodeLine{27 }
\DoxyCodeLine{28 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{29 }
\DoxyCodeLine{30 \textcolor{preprocessor}{\#include <osmocom/gsm/protocol/gsm\_23\_032.h>}}
\DoxyCodeLine{31 \textcolor{preprocessor}{\#include <osmocom/core/utils.h>}}
\DoxyCodeLine{32 }
\DoxyCodeLine{33 \textcolor{keyword}{struct }msgb;}
\DoxyCodeLine{34 }
\DoxyCodeLine{35 \textcolor{keyword}{struct }osmo\_gad\_ell\_point \{}
\DoxyCodeLine{37         int32\_t lat;}
\DoxyCodeLine{39         int32\_t lon;}
\DoxyCodeLine{40 \};}
\DoxyCodeLine{41 }
\DoxyCodeLine{42 \textcolor{keyword}{struct }osmo\_gad\_ell\_point\_unc\_circle \{}
\DoxyCodeLine{44         int32\_t lat;}
\DoxyCodeLine{46         int32\_t lon;}
\DoxyCodeLine{48         uint32\_t unc;}
\DoxyCodeLine{49 \};}
\DoxyCodeLine{50 }
\DoxyCodeLine{51 \textcolor{keyword}{struct }osmo\_gad\_ell\_point\_unc\_ellipse \{}
\DoxyCodeLine{53         int32\_t lat;}
\DoxyCodeLine{55         int32\_t lon;}
\DoxyCodeLine{58         uint32\_t unc\_semi\_major;}
\DoxyCodeLine{61         uint32\_t unc\_semi\_minor;}
\DoxyCodeLine{63         uint8\_t major\_ori;}
\DoxyCodeLine{65         uint8\_t confidence;}
\DoxyCodeLine{66 \};}
\DoxyCodeLine{67 }
\DoxyCodeLine{68 \textcolor{keyword}{struct }osmo\_gad\_polygon \{}
\DoxyCodeLine{69         uint8\_t num\_points;}
\DoxyCodeLine{70         \textcolor{keyword}{struct }osmo\_gad\_ell\_point point[15];}
\DoxyCodeLine{71 \};}
\DoxyCodeLine{72 }
\DoxyCodeLine{73 \textcolor{keyword}{struct }osmo\_gad\_ell\_point\_alt \{}
\DoxyCodeLine{75         int32\_t lat;}
\DoxyCodeLine{77         int32\_t lon;}
\DoxyCodeLine{79         int16\_t alt;}
\DoxyCodeLine{80 \};}
\DoxyCodeLine{81 }
\DoxyCodeLine{82 \textcolor{keyword}{struct }osmo\_gad\_ell\_point\_alt\_unc\_ell \{}
\DoxyCodeLine{84         int32\_t lat;}
\DoxyCodeLine{86         int32\_t lon;}
\DoxyCodeLine{88         int16\_t alt;}
\DoxyCodeLine{91         uint32\_t unc\_semi\_major;}
\DoxyCodeLine{94         uint32\_t unc\_semi\_minor;}
\DoxyCodeLine{96         uint8\_t major\_ori;}
\DoxyCodeLine{100         int32\_t unc\_alt;}
\DoxyCodeLine{102         uint8\_t confidence;}
\DoxyCodeLine{103 \};}
\DoxyCodeLine{104 }
\DoxyCodeLine{105 \textcolor{keyword}{struct }osmo\_gad\_ell\_arc \{}
\DoxyCodeLine{107         int32\_t lat;}
\DoxyCodeLine{109         int32\_t lon;}
\DoxyCodeLine{111         uint32\_t inner\_r;}
\DoxyCodeLine{114         uint32\_t unc\_r;}
\DoxyCodeLine{117         uint16\_t ofs\_angle;}
\DoxyCodeLine{120         uint16\_t incl\_angle;}
\DoxyCodeLine{122         uint8\_t confidence;}
\DoxyCodeLine{123 \};}
\DoxyCodeLine{124 }
\DoxyCodeLine{125 \textcolor{keyword}{struct }osmo\_gad\_ha\_ell\_point\_alt\_unc\_ell \{}
\DoxyCodeLine{127         int32\_t lat;}
\DoxyCodeLine{129         int32\_t lon;}
\DoxyCodeLine{131         int32\_t alt;}
\DoxyCodeLine{135         uint32\_t unc\_semi\_major;}
\DoxyCodeLine{139         uint32\_t unc\_semi\_minor;}
\DoxyCodeLine{141         uint8\_t major\_ori;}
\DoxyCodeLine{143         uint8\_t h\_confidence;}
\DoxyCodeLine{145         int32\_t unc\_alt;}
\DoxyCodeLine{147         uint8\_t v\_confidence;}
\DoxyCodeLine{148 \};}
\DoxyCodeLine{149 }
\DoxyCodeLine{150 \textcolor{keyword}{struct }osmo\_gad \{}
\DoxyCodeLine{151         \textcolor{keyword}{enum} gad\_type type;}
\DoxyCodeLine{152         \textcolor{keyword}{union }\{}
\DoxyCodeLine{153                 \textcolor{keyword}{struct }osmo\_gad\_ell\_point ell\_point;}
\DoxyCodeLine{154                 \textcolor{keyword}{struct }osmo\_gad\_ell\_point\_unc\_circle ell\_point\_unc\_circle;}
\DoxyCodeLine{155                 \textcolor{keyword}{struct }osmo\_gad\_ell\_point\_unc\_ellipse ell\_point\_unc\_ellipse;}
\DoxyCodeLine{156                 \textcolor{keyword}{struct }osmo\_gad\_polygon polygon;}
\DoxyCodeLine{157                 \textcolor{keyword}{struct }osmo\_gad\_ell\_point\_alt ell\_point\_alt;}
\DoxyCodeLine{158                 \textcolor{keyword}{struct }osmo\_gad\_ell\_point\_alt\_unc\_ell ell\_point\_alt\_unc\_ell;}
\DoxyCodeLine{159                 \textcolor{keyword}{struct }osmo\_gad\_ell\_arc ell\_arc;}
\DoxyCodeLine{160                 \textcolor{keyword}{struct }osmo\_gad\_ell\_point\_unc\_ellipse ha\_ell\_point\_unc\_ellipse;}
\DoxyCodeLine{161                 \textcolor{keyword}{struct }osmo\_gad\_ha\_ell\_point\_alt\_unc\_ell ha\_ell\_point\_alt\_unc\_ell;}
\DoxyCodeLine{162         \};}
\DoxyCodeLine{163 \};}
\DoxyCodeLine{164 }
\DoxyCodeLine{165 \textcolor{keyword}{struct }osmo\_gad\_err \{}
\DoxyCodeLine{166         \textcolor{keywordtype}{int} rc;}
\DoxyCodeLine{167         \textcolor{keyword}{enum} gad\_type type;}
\DoxyCodeLine{168         \textcolor{keywordtype}{char} *logmsg;}
\DoxyCodeLine{169 \};}
\DoxyCodeLine{170 }
\DoxyCodeLine{171 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string osmo\_gad\_type\_names[];}
\DoxyCodeLine{172 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_gad\_type\_name(\textcolor{keyword}{enum} gad\_type val)}
\DoxyCodeLine{173 \{ \textcolor{keywordflow}{return} get\_value\_string(osmo\_gad\_type\_names, val); \}}
\DoxyCodeLine{174 }
\DoxyCodeLine{175 \textcolor{keywordtype}{int} osmo\_gad\_raw\_write(\textcolor{keyword}{struct} msgb *msg, \textcolor{keyword}{const} \textcolor{keyword}{union} gad\_raw *gad\_raw);}
\DoxyCodeLine{176 \textcolor{keywordtype}{int} osmo\_gad\_raw\_read(\textcolor{keyword}{union} gad\_raw *gad\_raw, \textcolor{keyword}{struct} osmo\_gad\_err **err, \textcolor{keywordtype}{void} *err\_ctx, \textcolor{keyword}{const} uint8\_t *data, uint8\_t len);}
\DoxyCodeLine{177 }
\DoxyCodeLine{178 \textcolor{keywordtype}{int} osmo\_gad\_enc(\textcolor{keyword}{union} gad\_raw *gad\_raw, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_gad *gad);}
\DoxyCodeLine{179 \textcolor{keywordtype}{int} osmo\_gad\_dec(\textcolor{keyword}{struct} osmo\_gad *gad, \textcolor{keyword}{struct} osmo\_gad\_err **err, \textcolor{keywordtype}{void} *err\_ctx, \textcolor{keyword}{const} \textcolor{keyword}{union} gad\_raw *gad\_raw);}
\DoxyCodeLine{180 }
\DoxyCodeLine{181 \textcolor{keywordtype}{int} osmo\_gad\_to\_str\_buf(\textcolor{keywordtype}{char} *buf, \textcolor{keywordtype}{size\_t} buflen, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_gad *gad);}
\DoxyCodeLine{182 \textcolor{keywordtype}{char} *osmo\_gad\_to\_str\_c(\textcolor{keywordtype}{void} *ctx, \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_gad *gad);}
\DoxyCodeLine{183 }
\DoxyCodeLine{184 uint32\_t osmo\_gad\_enc\_lat(int32\_t deg\_1e6);}
\DoxyCodeLine{185 int32\_t osmo\_gad\_dec\_lat(uint32\_t lat);}
\DoxyCodeLine{186 uint32\_t osmo\_gad\_enc\_lon(int32\_t deg\_1e6);}
\DoxyCodeLine{187 int32\_t osmo\_gad\_dec\_lon(uint32\_t lon);}
\DoxyCodeLine{188 uint8\_t osmo\_gad\_enc\_unc(uint32\_t mm);}
\DoxyCodeLine{189 uint32\_t osmo\_gad\_dec\_unc(uint8\_t unc);}

\end{DoxyCode}
