aboutsummaryrefslogtreecommitdiffstats
path: root/pySim/cards.py
diff options
context:
space:
mode:
Diffstat (limited to 'pySim/cards.py')
-rw-r--r--pySim/cards.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pySim/cards.py b/pySim/cards.py
index b7be6e8..17da506 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -336,12 +336,16 @@ class IsimCard(Card):
def update_pcscf(self, pcscf):
if len(pcscf) > 0:
- content = enc_addr_tlv(pcscf)
+ addr_type = get_addr_type(pcscf)
+ if addr_type == None:
+ raise ValueError("Unknown PCSCF address type or invalid address provided")
+ content = enc_addr_tlv(pcscf, ('%02x' % addr_type))
else:
# Just the tag value
content = '80'
rec_size_bytes = self._scc.record_size(EF_ISIM_ADF_map['PCSCF'])
- data, sw = self._scc.update_record(EF_ISIM_ADF_map['PCSCF'], 1, rpad(content, rec_size_bytes*2))
+ pcscf_tlv = rpad(content, rec_size_bytes*2)
+ data, sw = self._scc.update_record(EF_ISIM_ADF_map['PCSCF'], 1, pcscf_tlv)
return sw
def read_domain(self):