diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2010-03-28 09:15:02 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-03-28 09:15:02 -0700 |
commit | 6af65670040c3e8ca51783fe74b785842a3002ca (patch) | |
tree | 358f093cb83143d3853bcd7ee019836279461221 /gatchat/gsmdial.c | |
parent | ee294d35b853a19669c91cc6e2fa932256d1a6ae (diff) | |
download | ofono-6af65670040c3e8ca51783fe74b785842a3002ca.tar.bz2 |
Enable PPP session suport for AT+CGDATA command
Diffstat (limited to 'gatchat/gsmdial.c')
-rw-r--r-- | gatchat/gsmdial.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/gatchat/gsmdial.c b/gatchat/gsmdial.c index 84a2fa51..fd68c5c8 100644 --- a/gatchat/gsmdial.c +++ b/gatchat/gsmdial.c @@ -219,20 +219,6 @@ out: return FALSE; } -static void at_cgact_up_cb(gboolean ok, GAtResult *result, gpointer user_data) -{ - char buf[64]; - - if (!ok) { - g_print("Error activating context\n"); - exit(1); - } - - sprintf(buf, "AT+CGDATA=\"PPP\",%u", option_cid); - - g_at_chat_send(modem, buf, none_prefix, NULL, NULL, NULL); -} - static void print_ip_address(const char *label, guint32 ip_addr) { struct in_addr addr; @@ -303,6 +289,20 @@ static void connect_cb(gboolean ok, GAtResult *result, gpointer user_data) g_at_ppp_open(ppp); } +static void at_cgact_up_cb(gboolean ok, GAtResult *result, gpointer user_data) +{ + char buf[64]; + + if (!ok) { + g_print("Error activating context\n"); + exit(1); + } + + sprintf(buf, "AT+CGDATA=\"PPP\",%u", option_cid); + + g_at_chat_send(modem, buf, none_prefix, connect_cb, NULL, NULL); +} + static void at_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data) { char buf[64]; @@ -315,11 +315,11 @@ static void at_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data) if (option_legacy == TRUE) { sprintf(buf, "ATD*99***%u#", option_cid); g_at_chat_send(modem, buf, none_prefix, - connect_cb, NULL, NULL); + connect_cb, NULL, NULL); } else { sprintf(buf, "AT+CGACT=1,%u", option_cid); g_at_chat_send(control, buf, none_prefix, - at_cgact_up_cb, NULL, NULL); + at_cgact_up_cb, NULL, NULL); } } |