aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/l1if.h
blob: d477e4768fefcb40ae29176daaaacc81499b1841 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#ifdef __cplusplus
}
#endif

/* ------------------------------------------------------------------------ */
/* Data interface handlers                                                  */
/* ------------------------------------------------------------------------ */
/* DATA interface                                                           */
/*                                                                          */
/* Messages on the data interface carry one radio burst per UDP message.    */
/*                                                                          */
/* Received Data Burst:                                                     */
/* 1 byte timeslot index                                                    */
/* 4 bytes GSM frame number, BE                                             */
/* 1 byte RSSI in -dBm                                                      */
/* 2 bytes correlator timing offset in 1/256 symbol steps, 2's-comp, BE     */
/* 148 bytes soft symbol estimates, 0 -> definite "0", 255 -> definite "1"  */
/* 2 bytes are not used, but being sent by OsmoTRX                          */
/*                                                                          */
/* Transmit Data Burst:                                                     */
/* 1 byte timeslot index                                                    */
/* 4 bytes GSM frame number, BE                                             */
/* 1 byte transmit level wrt ARFCN max, -dB (attenuation)                   */
/* 148 bytes output symbol values, 0 & 1                                    */
/* ------------------------------------------------------------------------ */

struct trxd_to_trx {
   uint8_t ts;
   uint32_t fn;
   uint8_t txlev;
   uint8_t symbols[148];
};

struct trxd_from_trx {
   uint8_t ts;
   uint32_t fn;
   uint8_t rssi;
   uint16_t toa;
   uint8_t symbols[148];
   uint8_t pad[2];
};

#define TRXC_BUF_SIZE	1024

struct TRX_C {
    char cmd[TRXC_BUF_SIZE];
};

#ifdef __cplusplus
void push_c(TRX_C* i);
TRX_C* pop_c();

void push_d(trxd_from_trx* i);
trxd_to_trx* pop_d();

#else


char* trxif_from_trx_c();
void trxif_to_trx_c(char* msg);

struct trxd_from_trx* trxif_from_trx_d();
void trxif_to_trx_d(struct trxd_to_trx* msg);

struct osmo_fd* get_c_fd();
struct osmo_fd* get_d_fd();

#endif