\doxysection{trxd.\+h}
\label{trxd_8h_source}\index{include/osmocom/trx/trxd.h@{include/osmocom/trx/trxd.h}}
\textbf{ Go to the documentation of this file.}
\begin{DoxyCode}{0}
\DoxyCodeLine{1 }
\DoxyCodeLine{3 \textcolor{preprocessor}{\#pragma once}}
\DoxyCodeLine{4 }
\DoxyCodeLine{5 \textcolor{preprocessor}{\#include <stdint.h>}}
\DoxyCodeLine{6 \textcolor{preprocessor}{\#include <stddef.h>}}
\DoxyCodeLine{7 }
\DoxyCodeLine{8 \textcolor{preprocessor}{\#include <osmocom/core/bits.h>}}
\DoxyCodeLine{9 \textcolor{preprocessor}{\#include <osmocom/core/utils.h>}}
\DoxyCodeLine{10 }
\DoxyCodeLine{11 \textcolor{keyword}{struct }msgb;}
\DoxyCodeLine{12 }
\DoxyCodeLine{14 \textcolor{preprocessor}{\#define OSMO\_TRXD\_PDU\_VER\_MAX           2}}
\DoxyCodeLine{15 }
\DoxyCodeLine{17 \textcolor{preprocessor}{\#define OSMO\_TRXD\_BURST\_LEN\_GMSK        148}}
\DoxyCodeLine{19 \textcolor{preprocessor}{\#define OSMO\_TRXD\_BURST\_LEN\_8PSK        444}}
\DoxyCodeLine{21 \textcolor{preprocessor}{\#define OSMO\_TRXD\_BURST\_LEN\_MAX         OSMO\_TRXD\_BURST\_LEN\_8PSK}}
\DoxyCodeLine{22 }
\DoxyCodeLine{26 \textcolor{preprocessor}{\#define OSMO\_TRXD\_HDR\_LEN\_MAX           12}}
\DoxyCodeLine{30 \textcolor{preprocessor}{\#define OSMO\_TRXD\_MSG\_BUF\_SIZE          (OSMO\_TRXD\_HDR\_LEN\_MAX + OSMO\_TRXD\_BURST\_LEN\_MAX)}}
\DoxyCodeLine{31 }
\DoxyCodeLine{33 \textcolor{keyword}{enum} osmo\_trxd\_mod\_type \{}
\DoxyCodeLine{34         OSMO\_TRXD\_MOD\_T\_GMSK,}
\DoxyCodeLine{35         OSMO\_TRXD\_MOD\_T\_8PSK,}
\DoxyCodeLine{36         OSMO\_TRXD\_MOD\_T\_AQPSK,}
\DoxyCodeLine{37         \textcolor{comment}{/* room for 16QAM/32QAM */}}
\DoxyCodeLine{38 \};}
\DoxyCodeLine{39 }
\DoxyCodeLine{40 \textcolor{comment}{/* Presence/meta flags for osmo\_trxd\_burst\_\{ind,req\} */}}
\DoxyCodeLine{41 \textcolor{preprocessor}{\#define OSMO\_TRXD\_F\_NOPE\_IND    (1 << 0) }}
\DoxyCodeLine{43 \textcolor{preprocessor}{\#define OSMO\_TRXD\_F\_NOPE\_REQ    OSMO\_TRXD\_F\_NOPE\_IND}}
\DoxyCodeLine{44 \textcolor{preprocessor}{\#define OSMO\_TRXD\_F\_MOD\_TYPE    (1 << 1) }}
\DoxyCodeLine{45 \textcolor{preprocessor}{\#define OSMO\_TRXD\_F\_TS\_INFO     (1 << 2) }}
\DoxyCodeLine{46 \textcolor{preprocessor}{\#define OSMO\_TRXD\_F\_CI\_CB       (1 << 3) }}
\DoxyCodeLine{47 \textcolor{preprocessor}{\#define OSMO\_TRXD\_F\_TRX\_NUM     (1 << 4) }}
\DoxyCodeLine{48 \textcolor{preprocessor}{\#define OSMO\_TRXD\_F\_BATCH\_IND   (1 << 5) }}
\DoxyCodeLine{49 \textcolor{preprocessor}{\#define OSMO\_TRXD\_F\_SHADOW\_IND  (1 << 6) }}
\DoxyCodeLine{50 \textcolor{preprocessor}{\#define OSMO\_TRXD\_F\_ACCESS\_BURST (1 << 7) }}
\DoxyCodeLine{57 \textcolor{keyword}{struct }osmo\_trxd\_burst\_ind \{}
\DoxyCodeLine{58         uint32\_t flags;            }
\DoxyCodeLine{60         \textcolor{comment}{/* Mandatory fields (all TRXD versions) */}}
\DoxyCodeLine{61         uint32\_t fn;          }
\DoxyCodeLine{62         uint8\_t tn;           }
\DoxyCodeLine{63         int16\_t toa256;           }
\DoxyCodeLine{64         int8\_t rssi;                }
\DoxyCodeLine{65         sbit\_t burst[OSMO\_TRXD\_BURST\_LEN\_MAX]; }
\DoxyCodeLine{66         \textcolor{keywordtype}{size\_t} burst\_len;      }
\DoxyCodeLine{68         \textcolor{comment}{/* Optional fields (presence indicated by flags) */}}
\DoxyCodeLine{69         \textcolor{keyword}{enum} osmo\_trxd\_mod\_type mod; }
\DoxyCodeLine{70         uint8\_t tsc\_set; }
\DoxyCodeLine{71         uint8\_t tsc;         }
\DoxyCodeLine{72         int16\_t ci\_cb;             }
\DoxyCodeLine{73         uint8\_t trx\_num; }
\DoxyCodeLine{74 \};}
\DoxyCodeLine{75 }
\DoxyCodeLine{78 \textcolor{keyword}{struct }osmo\_trxd\_burst\_req \{}
\DoxyCodeLine{79         uint32\_t flags;            }
\DoxyCodeLine{81         \textcolor{comment}{/* Mandatory fields (all TRXD versions) */}}
\DoxyCodeLine{82         uint32\_t fn;          }
\DoxyCodeLine{83         uint8\_t tn;           }
\DoxyCodeLine{84         uint8\_t att;         }
\DoxyCodeLine{85         ubit\_t burst[OSMO\_TRXD\_BURST\_LEN\_MAX]; }
\DoxyCodeLine{86         \textcolor{keywordtype}{size\_t} burst\_len;      }
\DoxyCodeLine{88         \textcolor{comment}{/* Optional fields (presence indicated by flags) */}}
\DoxyCodeLine{89         \textcolor{keyword}{enum} osmo\_trxd\_mod\_type mod; }
\DoxyCodeLine{90         uint8\_t tsc\_set; }
\DoxyCodeLine{91         uint8\_t tsc;         }
\DoxyCodeLine{92         int8\_t scpir;              }
\DoxyCodeLine{93         uint8\_t trx\_num; }
\DoxyCodeLine{94 \};}
\DoxyCodeLine{95 }
\DoxyCodeLine{98 \textcolor{keyword}{struct }osmo\_trxd\_parse\_state \{}
\DoxyCodeLine{99         uint8\_t pdu\_ver; }
\DoxyCodeLine{100         \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{int} num\_pdus;  }
\DoxyCodeLine{101         uint32\_t fn;          }
\DoxyCodeLine{102 \};}
\DoxyCodeLine{103 }
\DoxyCodeLine{104 \textcolor{keywordtype}{void} osmo\_trxd\_parse\_state\_init(\textcolor{keyword}{struct} osmo\_trxd\_parse\_state *st);}
\DoxyCodeLine{105 }
\DoxyCodeLine{106 \textcolor{keywordtype}{int} osmo\_trxd\_burst\_ind\_parse(\textcolor{keyword}{struct} osmo\_trxd\_parse\_state *st,}
\DoxyCodeLine{107                               \textcolor{keyword}{struct} osmo\_trxd\_burst\_ind *bi,}
\DoxyCodeLine{108                               \textcolor{keyword}{const} uint8\_t *buf, \textcolor{keywordtype}{size\_t} buf\_len);}
\DoxyCodeLine{109 \textcolor{keywordtype}{int} osmo\_trxd\_burst\_req\_parse(\textcolor{keyword}{struct} osmo\_trxd\_parse\_state *st,}
\DoxyCodeLine{110                               \textcolor{keyword}{struct} osmo\_trxd\_burst\_req *br,}
\DoxyCodeLine{111                               \textcolor{keyword}{const} uint8\_t *buf, \textcolor{keywordtype}{size\_t} buf\_len);}
\DoxyCodeLine{112 }
\DoxyCodeLine{113 \textcolor{keywordtype}{int} osmo\_trxd\_burst\_ind\_build(\textcolor{keyword}{struct} msgb *msg, uint8\_t pdu\_ver,}
\DoxyCodeLine{114                               \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_trxd\_burst\_ind *bi);}
\DoxyCodeLine{115 \textcolor{keywordtype}{int} osmo\_trxd\_burst\_req\_build(\textcolor{keyword}{struct} msgb *msg, uint8\_t pdu\_ver,}
\DoxyCodeLine{116                               \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_trxd\_burst\_req *br);}
\DoxyCodeLine{117 \textcolor{keywordtype}{void} osmo\_trxd\_build\_fin(\textcolor{keyword}{struct} msgb *msg, uint8\_t pdu\_ver);}
\DoxyCodeLine{118 }
\DoxyCodeLine{119 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_trxd\_burst\_ind\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_trxd\_burst\_ind *bi);}
\DoxyCodeLine{120 \textcolor{keywordtype}{char} *osmo\_trxd\_burst\_ind\_name\_buf(\textcolor{keywordtype}{char} *buf, \textcolor{keywordtype}{size\_t} buf\_len,}
\DoxyCodeLine{121                                    \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_trxd\_burst\_ind *bi);}
\DoxyCodeLine{122 \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_trxd\_burst\_req\_name(\textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_trxd\_burst\_req *br);}
\DoxyCodeLine{123 \textcolor{keywordtype}{char} *osmo\_trxd\_burst\_req\_name\_buf(\textcolor{keywordtype}{char} *buf, \textcolor{keywordtype}{size\_t} buf\_len,}
\DoxyCodeLine{124                                    \textcolor{keyword}{const} \textcolor{keyword}{struct} osmo\_trxd\_burst\_req *br);}
\DoxyCodeLine{125 }
\DoxyCodeLine{126 \textcolor{keyword}{extern} \textcolor{keyword}{const} \textcolor{keyword}{struct }value\_string osmo\_trxd\_mod\_type\_names[];}
\DoxyCodeLine{127 \textcolor{keyword}{static} \textcolor{keyword}{inline} \textcolor{keyword}{const} \textcolor{keywordtype}{char} *osmo\_trxd\_mod\_type\_name(\textcolor{keyword}{enum} osmo\_trxd\_mod\_type mod)}
\DoxyCodeLine{128 \{}
\DoxyCodeLine{129         \textcolor{keywordflow}{return} get\_value\_string(osmo\_trxd\_mod\_type\_names, mod);}
\DoxyCodeLine{130 \}}

\end{DoxyCode}
