diff options
author | Denis Kenzior <denkenz@gmail.com> | 2009-12-10 17:43:57 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-12-10 17:43:57 -0600 |
commit | 7a456aaf7a998607e7200561822e4109d41ec934 (patch) | |
tree | 56a4dc285fb3a8b18185c1ddd463eaf4460fdce9 /gatchat/gsmdial.c | |
parent | 62d8cf7aa3faf2055be132f25bfb164178fba8a0 (diff) | |
download | ofono-7a456aaf7a998607e7200561822e4109d41ec934.tar.bz2 |
Add offmode to gsmdial
Diffstat (limited to 'gatchat/gsmdial.c')
-rw-r--r-- | gatchat/gsmdial.c | 8 |
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 }, }; |