diff options
author | Harald Welte <laforge@osmocom.org> | 2020-06-03 15:19:40 +0200 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2020-08-28 08:32:55 +0000 |
commit | ca6739458e8eb8f15c981aa7343b66c770b42025 (patch) | |
tree | ab2262954e66a35324945a6fd932dacf7e90a9f5 /pySim/commands.py | |
parent | 3c0bd7a41e8b5d9ecb61e9eab5ea299966096d6d (diff) |
Add support for ADF_USIM/EF_EHPLMN
If the EF.EHPLMN exists, it contains the "Equivalent Home PLMN List".
The odd part of that list is that it is not just a list of additional
PLMN identities, but if the first digits of the IMSI are *not* listed
in EF.EHPLMN, then the MCC/MNC of the IMSI prefix is suddently no
longer considered the home network, but the subscriber is roaming.
See TS 23.122: "If the HPLMN code derived from the IMSI is not present
in the EHPLMN list, then it shall be treated as a Visited PLMN for PLMN
selection purposes."
Change-Id: I22d96ab4a424ec5bc1fb02f5e80165c646a748d3
Diffstat (limited to 'pySim/commands.py')
-rw-r--r-- | pySim/commands.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pySim/commands.py b/pySim/commands.py index 7288b19..c260a97 100644 --- a/pySim/commands.py +++ b/pySim/commands.py @@ -100,6 +100,17 @@ class SimCardCommands(object): def sel_ctrl(self, value): self._sel_ctrl = value + def try_select_file(self, dir_list): + rv = [] + if type(dir_list) is not list: + dir_list = [dir_list] + for i in dir_list: + data, sw = self._tp.send_apdu(self.cla_byte + "a4" + self.sel_ctrl + "02" + i) + rv.append((data, sw)) + if sw != '9000': + return rv + return rv + def select_file(self, dir_list): rv = [] if type(dir_list) is not list: |