diff options
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); } } |