Open Source Telephony
 help / color / mirror / Atom feed
From: Nicolas Bertrand <nicolas.bertrand@linux.intel.com>
To: ofono@ofono.org
Subject: [PATCH 2/2] ussd: Fix speedup ussd encoding
Date: Tue, 10 Apr 2012 17:35:05 +0200	[thread overview]
Message-ID: <1334072105-32105-3-git-send-email-nicolas.bertrand@linux.intel.com> (raw)
In-Reply-To: <1334072105-32105-1-git-send-email-nicolas.bertrand@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 1816 bytes --]

Speedup dongles encode USSD strings in GSM7
packed, so we don't have to pack it ourselves.
---
 drivers/atmodem/ussd.c |   13 ++++++++++---
 plugins/speedup.c      |    2 +-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/atmodem/ussd.c b/drivers/atmodem/ussd.c
index f5b38e2..e90db11 100644
--- a/drivers/atmodem/ussd.c
+++ b/drivers/atmodem/ussd.c
@@ -136,9 +136,15 @@ static void cusd_parse(GAtResult *result, struct ofono_ussd *ussd)
 	case SMS_CHARSET_7BIT:
 		switch (data->charset) {
 		case AT_UTIL_CHARSET_GSM:
-			msg_ptr = pack_7bit_own_buf((const guint8 *) content,
-							-1, 0, TRUE, &msg_len,
-							0, msg);
+			if (data->vendor == OFONO_VENDOR_SPEEDUP)
+				msg_ptr = decode_hex_own_buf(content, -1,
+								&msg_len,
+								0, msg);
+			else
+				msg_ptr = pack_7bit_own_buf((const guint8 *)
+								content, -1, 0,
+								TRUE, &msg_len,
+								0, msg);
 			break;
 
 		case AT_UTIL_CHARSET_UTF8:
@@ -242,6 +248,7 @@ static void cusd_cancel_cb(gboolean ok, GAtResult *result, gpointer user_data)
 	switch (data->vendor) {
 	case OFONO_VENDOR_GOBI:
 	case OFONO_VENDOR_QUALCOMM_MSM:
+	case OFONO_VENDOR_SPEEDUP:
 		/* All errors and notifications arrive unexpected and
 		 * thus just reset the state here. This is safer than
 		 * getting stuck in a dead-lock. */
diff --git a/plugins/speedup.c b/plugins/speedup.c
index ca6ed13..5cc380f 100644
--- a/plugins/speedup.c
+++ b/plugins/speedup.c
@@ -282,7 +282,7 @@ static void speedup_post_online(struct ofono_modem *modem)
 
 	ofono_cbs_create(modem, OFONO_VENDOR_QUALCOMM_MSM,
 						"atmodem", data->aux);
-	ofono_ussd_create(modem, OFONO_VENDOR_QUALCOMM_MSM,
+	ofono_ussd_create(modem, OFONO_VENDOR_SPEEDUP,
 						"atmodem", data->aux);
 }
 
-- 
1.7.5.4


  parent reply	other threads:[~2012-04-10 15:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-10 15:35 [PATCH 0/2] ussd fixes Nicolas Bertrand
2012-04-10 15:35 ` [PATCH 1/2] ussd: rise up buffer lenght for ussd strings Nicolas Bertrand
2012-04-10 13:55   ` Denis Kenzior
2012-04-10 15:35 ` Nicolas Bertrand [this message]
2012-04-10  7:53   ` [PATCH 2/2] ussd: Fix speedup ussd encoding Denis Kenzior
2012-04-10 21:22     ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1334072105-32105-3-git-send-email-nicolas.bertrand@linux.intel.com \
    --to=nicolas.bertrand@linux.intel.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox