aboutsummaryrefslogtreecommitdiffstats
path: root/pySim
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2021-09-16 13:18:01 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2021-10-15 10:36:55 +0200
commit5d698e575aa55137817c129a21aa6c0a407b589b (patch)
treefda4ce0748cfaa0d9c8684016a7ab458831be344 /pySim
parent3c309886e94f773b0c410f270898dc29e17c39d0 (diff)
pySim-shell: allow card insertion at runtime
Currently a card must be present in the reader until the user can enter pySim-shell. Removing and plugging another card is in theory already possible, but then the new card will operate on the old card and runtime state object. It might also be useful to enter pySim-shell before the card is plugged to execute some other commands for preperation before. So lets allow to "equip" pySim-shell with a card and rs object at runtime. Related: SYS#5617 Change-Id: I9cf532d9da8203065463c7201e7064de6c7ab1b5
Diffstat (limited to 'pySim')
-rw-r--r--pySim/filesystem.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index fe781de..cc9176f 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -1329,6 +1329,11 @@ class RuntimeState(object):
raise TypeError("Only works with BER-TLV EF")
return self.card._scc.set_data(self.selected_file.fid, tag, data_hex, conserve=self.conserve_write)
+ def unregister_cmds(self, cmd_app=None):
+ """Unregister all file specific commands."""
+ if cmd_app and self.selected_file.shell_commands:
+ for c in self.selected_file.shell_commands:
+ cmd_app.unregister_command_set(c)