File: netmon.h

package info (click to toggle)
ofono 2.18-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 12,064 kB
  • sloc: ansic: 224,979; sh: 5,012; python: 4,040; makefile: 956
file content (106 lines) | stat: -rw-r--r-- 3,004 bytes parent folder | download | duplicates (2)
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/*
 * oFono - Open Source Telephony
 * Copyright (C) 2008-2016  Intel Corporation
 *
 * SPDX-License-Identifier: GPL-2.0-only
 */

#ifndef __OFONO_NETMON_H
#define __OFONO_NETMON_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdarg.h>

#include <ofono/types.h>

struct ofono_netmon;

typedef void (*ofono_netmon_cb_t)(const struct ofono_error *error, void *data);

struct ofono_netmon_driver {
	unsigned int flags;
	int (*probe)(struct ofono_netmon *netmon, unsigned int vendor,
					void *data);
	int (*probev)(struct ofono_netmon *netmon, unsigned int vendor,
					va_list args);
	void (*remove)(struct ofono_netmon *netmon);
	void (*request_update)(struct ofono_netmon *netmon,
					ofono_netmon_cb_t cb, void *data);
	void (*enable_periodic_update)(struct ofono_netmon *netmon,
					unsigned int enable,
					unsigned int period,
					ofono_netmon_cb_t cb, void *data);
	void (*neighbouring_cell_update)(struct ofono_netmon *netmon,
					ofono_netmon_cb_t cb, void *data);
};

enum ofono_netmon_cell_type {
	OFONO_NETMON_CELL_TYPE_GSM,
	OFONO_NETMON_CELL_TYPE_UMTS,
	OFONO_NETMON_CELL_TYPE_LTE,
};

enum ofono_netmon_info {
	OFONO_NETMON_INFO_MCC, /* char *, up to 3 digits + null */
	OFONO_NETMON_INFO_MNC, /* char *, up to 3 digits + null */
	OFONO_NETMON_INFO_LAC, /* int */
	OFONO_NETMON_INFO_CI, /* int */
	OFONO_NETMON_INFO_ARFCN, /* int */
	OFONO_NETMON_INFO_BSIC, /* int */
	OFONO_NETMON_INFO_RXLEV, /* int */
	OFONO_NETMON_INFO_BER, /* int */
	OFONO_NETMON_INFO_RSSI, /* int */
	OFONO_NETMON_INFO_TIMING_ADVANCE, /* int */
	OFONO_NETMON_INFO_PSC, /* int */
	OFONO_NETMON_INFO_RSCP, /* int */
	OFONO_NETMON_INFO_ECN0, /* int */
	OFONO_NETMON_INFO_RSRQ, /* int */
	OFONO_NETMON_INFO_RSRP, /* int */
	OFONO_NETMON_INFO_EARFCN, /* int */
	OFONO_NETMON_INFO_EBAND, /* int */
	OFONO_NETMON_INFO_CQI, /* int */
	OFONO_NETMON_INFO_PCI, /* int */
	OFONO_NETMON_INFO_TAC, /* int */
	OFONO_NETMON_INFO_SNR, /* int */
	OFONO_NETMON_INFO_INVALID,
};

/*
 * Examples:
 * ofono_netmon_serving_cell_notify(netmon, OFONO_NETMON_CELL_TYPE_GSM,
 *					OFONO_NETMON_INFO_MCC, "123",
 *					OFONO_NETMON_INFO_MNC, "456",
 *					OFONO_NETMON_INFO_LAC, lac,
 *					OFONO_NETMON_INFO_CI, ci,
 *					OFONO_NETMON_INFO_RSSI, rssi,
 *					OFONO_NETMON_INFO_RXLEV, rxlev,
 *					OFONO_NETMON_INFO_INVALID);
 */
void ofono_netmon_serving_cell_notify(struct ofono_netmon *netmon,
					enum ofono_netmon_cell_type type,
					int info_type, ...);

struct ofono_netmon *ofono_netmon_create(struct ofono_modem *modem,
						unsigned int vendor,
						const char *driver, ...);

void ofono_netmon_register(struct ofono_netmon *netmon);

void ofono_netmon_remove(struct ofono_netmon *netmon);

void ofono_netmon_set_data(struct ofono_netmon *netmon, void *data);

void *ofono_netmon_get_data(struct ofono_netmon *netmon);

void ofono_netmon_neighbouring_cell_notify(struct ofono_netmon *netmon,
					enum ofono_netmon_cell_type type,
					int info_type, ...);

#ifdef __cplusplus
}
#endif

#endif /* __OFONO_NETMON_H */