summaryrefslogtreecommitdiffstats
path: root/include/modem.h
diff options
context:
space:
mode:
authorPekka Pessi <Pekka.Pessi@nokia.com>2010-05-26 17:58:06 +0300
committerDenis Kenzior <denkenz@gmail.com>2010-05-26 14:24:11 -0500
commit4f1506ba25c6e7a30566282879a63774477e0ca6 (patch)
treec41eaf81187e97b1deb877df6a5f42ce7900817e /include/modem.h
parent7bfe56efa2449c3afbb116f9cc4764042bf449bb (diff)
downloadofono-4f1506ba25c6e7a30566282879a63774477e0ca6.tar.bz2
Add: Online property to modem
The online/offline state is changed with the new set_online() modem driver method. In order to track atoms, there are modem states as follows: - OFONO_MODEM_STATE_POWER_OFF - OFONO_MODEM_STATE_PRE_SIM - OFONO_MODEM_STATE_OFFLINE - OFONO_MODEM_STATE_ONLINE Atoms are added with driver methods pre_sim(), post_sim() and post_online(). Atoms are removed by modem core when the state changes.
Diffstat (limited to 'include/modem.h')
-rw-r--r--include/modem.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/modem.h b/include/modem.h
index d502640b..69c7ad2c 100644
--- a/include/modem.h
+++ b/include/modem.h
@@ -50,6 +50,8 @@ void ofono_modem_remove(struct ofono_modem *modem);
void ofono_modem_set_powered(struct ofono_modem *modem, ofono_bool_t powered);
ofono_bool_t ofono_modem_get_powered(struct ofono_modem *modem);
+ofono_bool_t ofono_modem_get_online(struct ofono_modem *modem);
+
void ofono_modem_set_name(struct ofono_modem *modem, const char *name);
int ofono_modem_set_string(struct ofono_modem *modem,
@@ -64,6 +66,9 @@ int ofono_modem_set_boolean(struct ofono_modem *modem,
const char *key, bool value);
bool ofono_modem_get_boolean(struct ofono_modem *modem, const char *key);
+typedef void (*ofono_modem_online_cb)(const struct ofono_error *error,
+ void *data);
+
struct ofono_modem_driver {
const char *name;
@@ -80,11 +85,18 @@ struct ofono_modem_driver {
/* Power down device */
int (*disable)(struct ofono_modem *modem);
+ /* Enable or disable cellular radio */
+ void (*set_online)(struct ofono_modem *modem, ofono_bool_t online,
+ ofono_modem_online_cb callback, void *data);
+
/* Populate the atoms available without SIM / Locked SIM */
void (*pre_sim)(struct ofono_modem *modem);
/* Populate the atoms that are available with SIM / Unlocked SIM*/
void (*post_sim)(struct ofono_modem *modem);
+
+ /* Populate the atoms available online */
+ void (*post_online)(struct ofono_modem *modem);
};
int ofono_modem_driver_register(const struct ofono_modem_driver *);