Hi Jeevaka,
2010/9/1 Jeevaka Badrappan <jeevaka.badrappan(a)elektrobit.com>:
---
drivers/atmodem/ussd.c | 87 +++++++++++++++++++++++++++++------------------
1 files changed, 54 insertions(+), 33 deletions(-)
diff --git a/drivers/atmodem/ussd.c b/drivers/atmodem/ussd.c
index 1e1fc25..c386fcd 100644
--- a/drivers/atmodem/ussd.c
+++ b/drivers/atmodem/ussd.c
@@ -56,11 +56,12 @@ static void cusd_parse(GAtResult *result, struct ofono_ussd *ussd)
int status;
int dcs;
const char *content;
- char *converted = NULL;
gboolean udhi;
enum sms_charset charset;
gboolean compressed;
gboolean iso639;
+ unsigned char *msg = NULL;
+ int msg_len = 0;
g_at_result_iter_init(&iter, result);
@@ -83,24 +84,15 @@ static void cusd_parse(GAtResult *result, struct ofono_ussd *ussd)
} else
charset = SMS_CHARSET_7BIT;
- if (charset == SMS_CHARSET_7BIT)
- converted = convert_gsm_to_utf8((const guint8 *) content,
- strlen(content), NULL, NULL, 0);
-
- else if (charset == SMS_CHARSET_8BIT) {
- /* TODO: Figure out what to do with 8 bit data */
- ofono_error("8-bit coded USSD response received");
- status = 4; /* Not supported */
- } else {
- /* No other encoding is mentioned in TS27007 7.15 */
- ofono_error("Unsupported USSD data coding scheme (%02x)",
dcs);
- status = 4; /* Not supported */
+ out:
+ if (content){
+ msg = g_memdup(content, strlen(content));
+ msg_len = strlen(content);
}
-out:
- ofono_ussd_notify(ussd, status, converted);
+ ofono_ussd_notify(ussd, status, dcs, msg, msg_len);
I thought the modem already unpacks the ussd message to 8-bit gsm and
the dcs parameter is rather meaningless in that case. Perhaps the
atmodem ussd should re-pack the string in order to achieve the desired
symmetry on the API?
--
Pekka.Pessi mail at
nokia.com