aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2019-03-20 12:40:36 +0100
committerPhilipp Maier <pmaier@sysmocom.de>2019-03-21 18:04:26 +0100
commit2d15ea015e8d4f5d1de638e7790e1be7dce0e0db (patch)
treea1999d15969fa60c45bf85e395cf2ca0e21229fb
parent91f26d7f0aa97d4b86c88602fe03a15bf5f1393b (diff)
cards: sysmo-usim-sjs1: add programming of EF.PLMNsel, EF.PLMNwAcT and EF.OPLMNwAcT
The files EF.PLMNsel, EF.PLMNwAcT and EF.OPLMNwAcT are currently not programmed for sysmo-usim-sjs1, lets add them. Change-Id: I0cac3041f1902383d98d6dc211cf31ae6e3a610b Related: OS#3850
-rw-r--r--pySim/cards.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/pySim/cards.py b/pySim/cards.py
index 3a25040..1012cfd 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -536,7 +536,7 @@ class SysmoUSIMSJS1(Card):
def __init__(self, ssc):
super(SysmoUSIMSJS1, self).__init__(ssc)
self._scc.cla_byte = "00"
- self._scc.sel_ctrl = "000C"
+ self._scc.sel_ctrl = "0004" #request an FCP
@classmethod
def autodetect(kls, scc):
@@ -575,6 +575,25 @@ class SysmoUSIMSJS1(Card):
# write EF.IMSI
data, sw = self._scc.update_binary('6f07', enc_imsi(p['imsi']))
+ # EF.PLMNsel
+ if p.get('mcc') and p.get('mnc'):
+ sw = self.update_plmnsel(p['mcc'], p['mnc'])
+ if sw != '9000':
+ print("Programming PLMNsel failed with code %s"%sw)
+
+ # EF.PLMNwAcT
+ if p.get('mcc') and p.get('mnc'):
+ sw = self.update_plmn_act(p['mcc'], p['mnc'])
+ if sw != '9000':
+ print("Programming PLMNwAcT failed with code %s"%sw)
+
+ # EF.OPLMNwAcT
+ if p.get('mcc') and p.get('mnc'):
+ sw = self.update_oplmn_act(p['mcc'], p['mnc'])
+ if sw != '9000':
+ print("Programming OPLMNwAcT failed with code %s"%sw)
+
+
# EF.SMSP
r = self._scc.select_file(['3f00', '7f10'])
data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 104), force_len=True)