summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gatchat/gsmdial.c8
1 files changed, 7 insertions, 1 deletions
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 },
};