gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

encoding USSD string? (AT+CUSD)


From: Trevor Hawkins
Subject: encoding USSD string? (AT+CUSD)
Date: Wed, 06 Aug 2003 16:56:16 -0700

Hi,

I am attempting to use the AT+CUSD command with a Sony Ericsson T68i to
send USSD strings to the network.  I would like to use functions from
gsm-encoding.c to put the USSD string in the right format.  

We currently use gnokii SMS decoding functions from the atgen.c driver
and gsm-encoding.c for our project and they work great.  Thanks to all
contributors for the great software.


According to GSM 07.07, the string needs to be in the format:
----------------------------------------------------------------------
(1)  if <dcs> indicates that GSM 03.38 [25] default alphabet is used:

        (a) if TE character set other than "HEX" (refer command Select TE
Character Set +CSCS): ME/TA converts GSM alphabet into current TE
character set according to rules of GSM 07.05 [24] Annex A

        (b) if TE character set is "HEX": ME/TA converts each 7 bit character
of GSM alphabet into two IRA character long hexadecimal number (e.g.
character  (GSM 23) is presented as 17 (IRA 49 and 55))

(2)  if <dcs> indicates that 8 bit data coding scheme is used: ME/TA
converts each 8 bit octet into two IRA character long hexadecimal number
(e.g. octet with integer value 42 is presented to TE as two characters
2A (IRA 50 and 65))
----------------------------------------------------------------------

The T68i has no <dcs> option, according to the AT command spec:
        Set command: AT+CUSD=[<n>[,<str>]]
And all other SMS functions use the default GSM TE character set, i.e.
AT+CSCS="GSM" is phone's default.  

To read SMS, I am calling hex2bin() on the PDU and then
sms_data_decode() which decodes the 7bit SMS text with
char_7bit_unpack() followed by char_ascii_decode().  

I believe the USSD string should be in the format desribed by (1a), i.e.
for T68i: default GSM alphabet.  So, I have simply tried reversing the
SMS read (minus headers) to create the USSD string.  I call:
char_ascii_encode() [optionally], char_7bit_pack() and then bin2hex(). 
This makes a HEX string but when sent to the phone via AT+CUSD, it
always returns "ERROR" after a couple seconds, no matter the string.

If anyone could tell me if I am on the right track or if this even makes
sense, it would be greatly appreciated.  Thanks.

Cheers,
Trevor








reply via email to

[Prev in Thread] Current Thread [Next in Thread]