summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-08-16 22:38:38 +0200
committerMarcel Holtmann <marcel@holtmann.org>2010-08-16 22:38:38 +0200
commit10466f6664dfaf327b27cac60e0c560e038c8498 (patch)
tree59c11fd105b44fd1216ddd86e12802ddd5f20c60 /drivers
parenta79901e26fa58c603494214a07d021964f589f55 (diff)
downloadofono-10466f6664dfaf327b27cac60e0c560e038c8498.tar.bz2
atmodem: Add Qualcomm specific USSD quirk
Diffstat (limited to 'drivers')
-rw-r--r--drivers/atmodem/ussd.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/atmodem/ussd.c b/drivers/atmodem/ussd.c
index 4bfa69c8..13b049f3 100644
--- a/drivers/atmodem/ussd.c
+++ b/drivers/atmodem/ussd.c
@@ -35,6 +35,7 @@
#include <ofono/ussd.h>
#include "util.h"
#include "smsutil.h"
+#include "vendor.h"
#include "gatchat.h"
#include "gatresult.h"
@@ -150,6 +151,15 @@ static void at_ussd_request(struct ofono_ussd *ussd, const char *str,
g_free(converted);
converted = NULL;
+ if (data->vendor == OFONO_VENDOR_QUALCOMM_MSM) {
+ /* Ensure that the modem is using GSM character set. It
+ * seems it defaults to IRA and then umlauts are not
+ * properly encoded. The modem returns some weird from
+ * of Latin-1, but it is not really Latin-1 either. */
+ g_at_chat_send(data->chat, "AT+CSCS=\"GSM\"", none_prefix,
+ NULL, NULL, NULL);
+ }
+
if (g_at_chat_send(data->chat, buf, cusd_prefix,
cusd_request_cb, cbd, g_free) > 0)
return;
@@ -165,10 +175,19 @@ static void cusd_cancel_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_ussd_cb_t cb = cbd->cb;
+ struct ussd_data *data = cbd->user;
struct ofono_error error;
decode_at_error(&error, g_at_result_final_response(result));
+ if (data->vendor == OFONO_VENDOR_QUALCOMM_MSM) {
+ /* All errors and notifications arrive unexpected and
+ * thus just reset the state here. This is safer than
+ * getting stuck in a dead-lock. */
+ error.type = OFONO_ERROR_TYPE_NO_ERROR;
+ error.error = 0;
+ }
+
cb(&error, cbd->data);
}
@@ -181,6 +200,8 @@ static void at_ussd_cancel(struct ofono_ussd *ussd,
if (!cbd)
goto error;
+ cbd->user = data;
+
if (g_at_chat_send(data->chat, "AT+CUSD=2", none_prefix,
cusd_cancel_cb, cbd, g_free) > 0)
return;