summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Tarasikov <alexander.tarasikov@gmail.com>2012-07-06 16:01:35 +0400
committerAlexander Tarasikov <alexander.tarasikov@gmail.com>2012-07-06 16:01:35 +0400
commit92b6f145f3379bc2c5262e5f977856d06bbfa121 (patch)
treeb7d459f76a4494266bd5fb54e1ca783e0a1a1d7d
parent9f3c5150ab0db61899bf5a8839b854c436e707bf (diff)
downloadhardware_ril_samsung-ril-92b6f145f3379bc2c5262e5f977856d06bbfa121.zip
hardware_ril_samsung-ril-92b6f145f3379bc2c5262e5f977856d06bbfa121.tar.gz
hardware_ril_samsung-ril-92b6f145f3379bc2c5262e5f977856d06bbfa121.tar.bz2
Hack ussd for latin ascii to make it work at least
-rw-r--r--util.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/util.c b/util.c
index 5f7b716..03b3df7 100644
--- a/util.c
+++ b/util.c
@@ -134,6 +134,9 @@ int ascii2gsm7(char *data, unsigned char **data_enc, int length)
enc_length = ((length * 7) - (length * 7) % 8) / 8;
enc_length += (length * 7) % 8 > 0 ? 1 : 0;
+ //FIXME: why does samsung does that?
+ enc_length++;
+
enc = malloc(enc_length);
memset(enc, 0, enc_length);
@@ -159,6 +162,10 @@ int ascii2gsm7(char *data, unsigned char **data_enc, int length)
}
*data_enc = enc;
+
+ //FIXME: what is going on here?
+ enc[enc_length - 2] |= 0x30;
+ enc[enc_length - 1] = 0x02;
return enc_length;
}