* [PATCH 1/2] Fix: Change order of CMER and CIND in SLC connection
@ 2009-11-25 5:47 Zhenhua Zhang
2009-11-25 2:49 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: Zhenhua Zhang @ 2009-11-25 5:47 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2256 bytes --]
These two patches fix AT command order issue during service level
connection to comply with HFP v1.5 spec.
The first patch is to change order from CIND=?, CMER, CIND? to
CIND=?, CIND?, CMER.
---
plugins/hfp.c | 40 ++++++++++++++++++++--------------------
1 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/plugins/hfp.c b/plugins/hfp.c
index fc29ad9..6e630e8 100644
--- a/plugins/hfp.c
+++ b/plugins/hfp.c
@@ -63,6 +63,22 @@ static void hfp_debug(const char *str, void *user_data)
ofono_info("%s", str);
}
+static void cmer_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ struct hfp_data *data = ofono_modem_get_data(modem);
+
+ if (!ok) {
+ hfp_disable(modem);
+ return;
+ }
+
+ ofono_info("Service level connection established");
+ g_at_chat_send(data->chat, "AT+CMEE=1", NULL, NULL, NULL, NULL);
+
+ ofono_modem_set_powered(modem, TRUE);
+}
+
static void cind_status_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
@@ -95,30 +111,14 @@ static void cind_status_cb(gboolean ok, GAtResult *result,
index += 1;
}
- ofono_info("Service level connection established");
- g_at_chat_send(data->chat, "AT+CMEE=1", NULL, NULL, NULL, NULL);
-
- ofono_modem_set_powered(modem, TRUE);
+ g_at_chat_send(data->chat, "AT+CMER=3,0,0,1", cmer_prefix,
+ cmer_cb, modem, NULL);
return;
error:
hfp_disable(modem);
}
-static void cmer_cb(gboolean ok, GAtResult *result, gpointer user_data)
-{
- struct ofono_modem *modem = user_data;
- struct hfp_data *data = ofono_modem_get_data(modem);
-
- if (!ok) {
- hfp_disable(modem);
- return;
- }
-
- g_at_chat_send(data->chat, "AT+CIND?", cind_prefix,
- cind_status_cb, modem, NULL);
-}
-
static void cind_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct ofono_modem *modem = user_data;
@@ -171,8 +171,8 @@ static void cind_cb(gboolean ok, GAtResult *result, gpointer user_data)
index += 1;
}
- g_at_chat_send(data->chat, "AT+CMER=3,0,0,1", cmer_prefix,
- cmer_cb, modem, NULL);
+ g_at_chat_send(data->chat, "AT+CIND?", cind_prefix,
+ cind_status_cb, modem, NULL);
return;
error:
--
1.6.2.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-25 5:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-25 5:47 [PATCH 1/2] Fix: Change order of CMER and CIND in SLC connection Zhenhua Zhang
2009-11-25 2:49 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.