From 7a456aaf7a998607e7200561822e4109d41ec934 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Thu, 10 Dec 2009 17:43:57 -0600 Subject: Add offmode to gsmdial --- gatchat/gsmdial.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gatchat/gsmdial.c') diff --git a/gatchat/gsmdial.c b/gatchat/gsmdial.c index ff2389aa..265b4dde 100644 --- a/gatchat/gsmdial.c +++ b/gatchat/gsmdial.c @@ -43,6 +43,7 @@ static gchar *option_modem = NULL; static gchar *option_control = NULL; static gint option_cid = 0; static gchar *option_apn = NULL; +static gint option_offmode = 0; static GAtChat *control; static GAtChat *modem; @@ -90,8 +91,11 @@ static gboolean signal_cb(GIOChannel *channel, GIOCondition cond, gpointer data) case SIGINT: case SIGTERM: if (terminated == 0) { + char buf[64]; + g_timeout_add_seconds(10, quit_eventloop, NULL); - g_at_chat_send(control, "AT+CFUN=0", none_prefix, + sprintf(buf, "AT+CFUN=%u", option_offmode); + g_at_chat_send(control, buf, none_prefix, power_down, NULL, NULL); } @@ -389,6 +393,8 @@ static GOptionEntry options[] = { "Specify CID to use" }, { "apn", 'a', 0, G_OPTION_ARG_STRING, &option_apn, "Specify APN" }, + { "offmode", 'a', 0, G_OPTION_ARG_INT, &option_offmode, + "Specify CFUN offmode" }, { NULL }, }; -- cgit v1.2.3