5687a245d677a1af382830fcdfa28ce8274d0ddb
[platform/upstream/ofono.git] / include / cdma-netreg.h
1 /*
2  *
3  *  oFono - Open Source Telephony
4  *
5  *  Copyright (C) 2008-2011  Intel Corporation. All rights reserved.
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License version 2 as
9  *  published by the Free Software Foundation.
10  *
11  *  This program is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  *  GNU General Public License for more details.
15  *
16  *  You should have received a copy of the GNU General Public License
17  *  along with this program; if not, write to the Free Software
18  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  *
20  */
21
22 #ifndef __OFONO_CDMA_NETREG_H
23 #define __OFONO_CDMA_NETREG_H
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 #include <ofono/types.h>
30
31 enum cdma_netreg_status {
32         CDMA_NETWORK_REGISTRATION_STATUS_NOT_REGISTERED =       0,
33         CDMA_NETWORK_REGISTRATION_STATUS_REGISTERED =           1,
34         CDMA_NETWORK_REGISTRATION_STATUS_ROAMING =              2,
35 };
36
37 struct ofono_cdma_netreg;
38
39 struct ofono_cdma_netreg_driver {
40         const char *name;
41         int (*probe)(struct ofono_cdma_netreg *cdma_netreg,
42                                 unsigned int vendor,
43                                 void *data);
44         void (*remove)(struct ofono_cdma_netreg *cdma_netreg);
45 };
46
47 void ofono_cdma_netreg_status_notify(struct ofono_cdma_netreg *netreg,
48                                 enum cdma_netreg_status status);
49 void ofono_cdma_netreg_strength_notify(struct ofono_cdma_netreg *netreg,
50                                 int strength);
51 void ofono_cdma_netreg_data_strength_notify(struct ofono_cdma_netreg *netreg,
52                                 int data_strength);
53
54 int ofono_cdma_netreg_driver_register(
55                                 const struct ofono_cdma_netreg_driver *d);
56 void ofono_cdma_netreg_driver_unregister(
57                                 const struct ofono_cdma_netreg_driver *d);
58
59 struct ofono_cdma_netreg *ofono_cdma_netreg_create(
60                                 struct ofono_modem *modem,
61                                 unsigned int vendor,
62                                 const char *driver,
63                                 void *data);
64
65 void ofono_cdma_netreg_register(struct ofono_cdma_netreg *cdma_netreg);
66 void ofono_cdma_netreg_remove(struct ofono_cdma_netreg *cdma_netreg);
67
68 void ofono_cdma_netreg_set_data(struct ofono_cdma_netreg *cdma_netreg,
69                                 void *data);
70 void *ofono_cdma_netreg_get_data(struct ofono_cdma_netreg *cdma_netreg);
71
72 #ifdef __cplusplus
73 }
74 #endif
75
76 #endif /* __OFONO_CDMA_NETREG_H */