All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH] ussd: Fix crash with long ussd string
Date: Fri, 30 Mar 2012 01:38:30 -0500	[thread overview]
Message-ID: <4F7554E6.6000703@gmail.com> (raw)
In-Reply-To: <1333113396-1158-1-git-send-email-nicolas.bertrand@linux.intel.com>

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

Hi Nicolas,

On 03/30/2012 08:16 AM, Nicolas Bertrand wrote:
> Some ZTE modem convert USSD string into UCS2 without respecting
> the limitation of 160 bytes. So cut off the string if greater than
> this limit
> ---
>  drivers/atmodem/ussd.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/atmodem/ussd.c b/drivers/atmodem/ussd.c
> index 443251a..bdee2d9 100644
> --- a/drivers/atmodem/ussd.c
> +++ b/drivers/atmodem/ussd.c
> @@ -158,7 +158,7 @@ static void cusd_parse(GAtResult *result, struct ofono_ussd *ussd)
>  
>  	case SMS_CHARSET_8BIT:
>  	case SMS_CHARSET_UCS2:
> -		msg_ptr = decode_hex_own_buf(content, -1, &msg_len, 0, msg);
> +		msg_ptr = decode_hex_own_buf(content, 320, &msg_len, 0, msg);
>  		break;
>  	}
>  

This isn't really the problem.  From the logs it seems that the ZTE
modem is sending us plain-text data that is hex-encoded in UCS2.

e.g.:

ofonod[1051]: Modem: < \r\n+CUSD:
1,"006D006F0062006900630061007200740065000A0056006F007400720065002000630072006500640069007400200065007300740020006500700075006900730065002E000A0050006F0075007200200063006F006E00730065007200760065007200200076006F0074007200650020006E0075006D00650072006F00200030003600340035003300310032003100310038000A00700065006E00730065007A0020006100200072006500630068006100720067006500720020006100760061006E00740020006C0065002000320031002F00300037002F00310032000A0031003D005200650063006800610072006700650072000A0032003D004D0065006E0075000A0033003D00410069006400650020002000200020",72\r\n

-> 006D, 006F, 0062, 0069, 0063, 0061, 0072, 0074, 0065 ...
    m     o     b    i     c     a     r     t     e    ...

Regards,
-Denis

      reply	other threads:[~2012-03-30  6:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-30 13:16 [PATCH] ussd: Fix crash with long ussd string Nicolas Bertrand
2012-03-30  6:38 ` Denis Kenzior [this message]

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=4F7554E6.6000703@gmail.com \
    --to=denkenz@gmail.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 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.