summaryrefslogtreecommitdiffstats
path: root/src/modem.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2011-04-04 23:48:41 -0500
committerDenis Kenzior <denkenz@gmail.com>2011-04-04 23:48:41 -0500
commitff04d53e32e94a7a158415e37ff19b4edf3bd42c (patch)
tree0c723e7e56938e961c489ce82ffceba4d0ea5b91 /src/modem.c
parent4ee289a4abcce0fe30763c076baf1a2c650dfc19 (diff)
downloadofono-ff04d53e32e94a7a158415e37ff19b4edf3bd42c.tar.bz2
modem: Tweak online logic if set_online is missing
In case set_online is missing, we should set online mode directly. If we're already online then set our state to Online, otherwise check if we should get Online.
Diffstat (limited to 'src/modem.c')
-rw-r--r--src/modem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/modem.c b/src/modem.c
index 4ec5988d..a8b8744d 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -671,7 +671,10 @@ static void sim_state_watch(enum ofono_sim_state new_state, void *user)
* If we don't have the set_online method, also proceed
* straight to the online state
*/
- if (modem->driver->set_online == NULL || modem->online == TRUE)
+ if (modem->driver->set_online == NULL)
+ set_online(modem, TRUE);
+
+ if (modem->online == TRUE)
modem_change_state(modem, MODEM_STATE_ONLINE);
else if (modem->get_online)
modem->driver->set_online(modem, 1, common_online_cb,