summaryrefslogtreecommitdiffstats
path: root/src/simutil.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2009-08-07 14:19:55 -0500
committerDenis Kenzior <denkenz@gmail.com>2009-08-07 15:49:30 -0500
commitf4037d77f7f0d5a6a9b29794d1651a60d1766806 (patch)
tree9093eb1cb2d2a37c8c633fc60be16a271bf13f6f /src/simutil.c
parentf93962078c365a20190106324e02c07b2d488562 (diff)
downloadofono-f4037d77f7f0d5a6a9b29794d1651a60d1766806.tar.bz2
Fix sim ADN type of number handling
The type of number stored here is not quite the same as SMS number, and should be parsed differently
Diffstat (limited to 'src/simutil.c')
-rw-r--r--src/simutil.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/simutil.c b/src/simutil.c
index 0fc40865..1dc310bf 100644
--- a/src/simutil.c
+++ b/src/simutil.c
@@ -420,7 +420,7 @@ gboolean sim_adn_parse(const unsigned char *data, int length,
if (number_len > 11 || ton_npi == 0xff)
return FALSE;
- ph->type = bit_field(ton_npi, 4, 3);
+ ph->type = ton_npi;
/* BCD coded, however the TON/NPI is given by the first byte */
number_len = (number_len - 1) * 2;
@@ -445,7 +445,7 @@ void sim_adn_build(unsigned char *data, int length,
*data++ = number_len + 1;
/* Use given number type and 'Unknown' for Numbering Plan */
- *data++ = 0x80 | (ph->type << 4) | 0;
+ *data++ = ph->type;
encode_bcd_number(ph->number, data);
memset(data + number_len, 0xff, 10 - number_len);