mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-26 07:18:33 +03:00
filesystem: Introduce the basic notion of 'logical channels'
cards can have multiple logical channels; each logical channel has its own state of what is the current selected file + application. Let's split the RuntimeState class into the global RuntimeState and the per-lchan-specific RuntimeLchan class. This code doesn't actually introduce any code that uses lchans other than the basic logical channel (0), but just modifies the data model to accomodate those in the future. Change-Id: I7aa994b625467d4e46a2edd8123240b930305360
This commit is contained in:
@@ -542,15 +542,15 @@ class EF_IMSI(TransparentEF):
|
||||
"""Change the plmn part of the IMSI"""
|
||||
plmn = arg.strip()
|
||||
if len(plmn) == 5 or len(plmn) == 6:
|
||||
(data, sw) = self._cmd.rs.read_binary_dec()
|
||||
(data, sw) = self._cmd.lchan.read_binary_dec()
|
||||
if sw == '9000' and len(data['imsi'])-len(plmn) == 10:
|
||||
imsi = data['imsi']
|
||||
msin = imsi[len(plmn):]
|
||||
(data, sw) = self._cmd.rs.update_binary_dec(
|
||||
(data, sw) = self._cmd.lchan.update_binary_dec(
|
||||
{'imsi': plmn+msin})
|
||||
if sw == '9000' and data:
|
||||
self._cmd.poutput_json(
|
||||
self._cmd.rs.selected_file.decode_hex(data))
|
||||
self._cmd.lchan.selected_file.decode_hex(data))
|
||||
else:
|
||||
raise ValueError("PLMN length does not match IMSI length")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user