summaryrefslogtreecommitdiffstats
path: root/src/host/gsmmap/log.h
blob: d1520101fb9192292a88448d94386bbc78601ec9 (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
75
76
77
78
79
80
enum {
	LOG_TYPE_NONE = 0,
	LOG_TYPE_SYSINFO,
	LOG_TYPE_POWER,
};

struct power {
	uint8_t gps_valid;
	double longitude, latitude;
	time_t gmt;
	int8_t rxlev[1024];
};

struct node_power {
	struct node_power *next;
	struct power power;
};

struct node_mcc {
	struct node_mcc *next;
	uint16_t mcc;
	struct node_mnc *mnc;
};

struct node_mnc {
	struct node_mnc *next;
	uint16_t mnc;
	struct node_lac *lac;
};

struct node_lac {
	struct node_lac *next;
	uint16_t lac;
	struct node_cell *cell;
};

struct sysinfo {
	uint16_t arfcn;
	int8_t rxlev;
	uint8_t bsic;
	uint8_t gps_valid;
	double longitude, latitude;
	time_t gmt;
	uint8_t	si1[23];
	uint8_t	si2[23];
	uint8_t	si2bis[23];
	uint8_t	si2ter[23];
	uint8_t	si3[23];
	uint8_t	si4[23];
	uint8_t ta_valid;
	uint8_t ta;
};

struct node_cell {
	struct node_cell *next;
	uint16_t cellid;
	uint8_t content; /* indicates, if sysinfo is already applied */
	struct node_meas *meas, **meas_last_p;
	struct sysinfo sysinfo;
	struct gsm48_sysinfo s;
};

struct node_meas {
	struct node_meas *next;
	time_t gmt;
	int8_t rxlev;
	uint8_t gps_valid;
	double longitude, latitude;
	uint8_t ta_valid;
	uint8_t ta;
};

struct node_mcc *get_node_mcc(uint16_t mcc);
struct node_mnc *get_node_mnc(struct node_mcc *mcc, uint16_t mnc);
struct node_lac *get_node_lac(struct node_mnc *mnc, uint16_t lac);
struct node_cell *get_node_cell(struct node_lac *lac, uint16_t cellid);
struct node_meas *add_node_meas(struct node_cell *cell);
int read_log(FILE *infp);