diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-05-10 16:36:33 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-05-10 16:36:33 -0500 |
commit | 1794ad32fd2ad702a94c6c14e0f9fbcf281a70de (patch) | |
tree | 174416b6ab7285c09f20392c1db5786c8fcdb825 /gatchat/gsmdial.c | |
parent | 3946d7e07c4202461506df81307931734bed1b3b (diff) | |
download | ofono-1794ad32fd2ad702a94c6c14e0f9fbcf281a70de.tar.bz2 |
gsmdial: Shut down cleanly when ppp link dies
Diffstat (limited to 'gatchat/gsmdial.c')
-rw-r--r-- | gatchat/gsmdial.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gatchat/gsmdial.c b/gatchat/gsmdial.c index cfdec87e..a7d38c92 100644 --- a/gatchat/gsmdial.c +++ b/gatchat/gsmdial.c @@ -234,9 +234,12 @@ static void ppp_connect(const char *iface, const char *ip, static void ppp_disconnect(GAtPPPDisconnectReason reason, gpointer user_data) { + char buf[64]; g_print("PPP Link down: %d\n", reason); - g_at_chat_resume(control); g_at_chat_resume(modem); + + sprintf(buf, "AT+CFUN=%u", option_offmode); + g_at_chat_send(control, buf, none_prefix, power_down, NULL, NULL); } static void connect_cb(gboolean ok, GAtResult *result, gpointer user_data) @@ -255,7 +258,6 @@ static void connect_cb(gboolean ok, GAtResult *result, gpointer user_data) * shutdown gatchat or else it tries to take all the input * from the modem and does not let PPP get it. */ - g_at_chat_suspend(control); g_at_chat_suspend(modem); /* open ppp */ |