---
 drivers/atmodem/ussd.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/drivers/atmodem/ussd.c b/drivers/atmodem/ussd.c
index 1e1fc25..30145ad 100644
--- a/drivers/atmodem/ussd.c
+++ b/drivers/atmodem/ussd.c
@@ -44,12 +44,25 @@
 
 static const char *cusd_prefix[] = { "+CUSD:", NULL };
 static const char *none_prefix[] = { NULL };
+static const char *cscs_prefix[] = { "+CSCS:", NULL };
 
 struct ussd_data {
        GAtChat *chat;
        unsigned int vendor;
+       enum at_util_charset charset;
 };
 
+static void read_charset_cb(gboolean ok, GAtResult *result,
+                               gpointer user_data)
+{
+       struct ussd_data *data = user_data;
+
+       if (!ok)
+               return;
+
+       at_util_parse_cscs_query(result, &data->charset);
+}
+
 static void cusd_parse(GAtResult *result, struct ofono_ussd *ussd)
 {
        GAtResultIter iter;
@@ -247,6 +260,9 @@ static int at_ussd_probe(struct ofono_ussd *ussd, unsigned 
int vendor,
 
        ofono_ussd_set_data(ussd, data);
 
+       g_at_chat_send(chat, "AT+CSCS?", cscs_prefix, read_charset_cb, data,
+                       NULL);
+
        g_at_chat_send(chat, "AT+CUSD=1", NULL, at_ussd_register, ussd, NULL);
 
        return 0;
-- 
1.7.0.4

_______________________________________________
ofono mailing list
ofono@ofono.org
http://lists.ofono.org/listinfo/ofono

Reply via email to