summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKalle Valo <kalle.valo@canonical.com>2010-05-25 17:23:26 +0300
committerDenis Kenzior <denkenz@gmail.com>2010-05-25 09:47:03 -0500
commit99e4200c64b82e67effa87243045218745edd291 (patch)
tree699d5f807cd2b594a02c21df0ba74178660585cd /plugins
parent2d3c0cd3b0e9f52d2ae1ec1777228288e5d92fd9 (diff)
downloadofono-99e4200c64b82e67effa87243045218745edd291.tar.bz2
huawei: send a prefix with AT commands
Diffstat (limited to 'plugins')
-rw-r--r--plugins/huawei.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/huawei.c b/plugins/huawei.c
index 962895a8..d7697b99 100644
--- a/plugins/huawei.c
+++ b/plugins/huawei.c
@@ -47,6 +47,9 @@
#include <drivers/atmodem/atutil.h>
#include <drivers/atmodem/vendor.h>
+static const char *none_prefix[] = { NULL };
+static const char *sysinfo_prefix[] = { "^SYSINFO:", NULL };
+
struct huawei_data {
GAtChat *chat;
GAtChat *event;
@@ -167,7 +170,8 @@ static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
FALSE, modem, NULL);
/* query current sim state */
- g_at_chat_send(data->chat, "AT^SYSINFO", NULL, sysinfo_cb, modem, NULL);
+ g_at_chat_send(data->chat, "AT^SYSINFO", sysinfo_prefix,
+ sysinfo_cb, modem, NULL);
}
static GAtChat *create_port(const char *device)
@@ -231,9 +235,9 @@ static int huawei_enable(struct ofono_modem *modem)
data->sim_state = 0;
- g_at_chat_send(data->chat, "ATE0", NULL, NULL, NULL, NULL);
+ g_at_chat_send(data->chat, "ATE0", none_prefix, NULL, NULL, NULL);
- g_at_chat_send(data->chat, "AT+CFUN=1", NULL,
+ g_at_chat_send(data->chat, "AT+CFUN=1", none_prefix,
cfun_enable, modem, NULL);
return -EINPROGRESS;
@@ -271,7 +275,7 @@ static int huawei_disable(struct ofono_modem *modem)
g_at_chat_cancel_all(data->chat);
g_at_chat_unregister_all(data->chat);
- g_at_chat_send(data->chat, "AT+CFUN=0", NULL,
+ g_at_chat_send(data->chat, "AT+CFUN=0", none_prefix,
cfun_disable, modem, NULL);
return -EINPROGRESS;