Change in pysim[master]: ts_31_10x: add a class for CardApplicationXSIM

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

dexter gerrit-no-reply at lists.osmocom.org
Wed Oct 20 07:44:42 UTC 2021


dexter has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/25818 )

Change subject: ts_31_10x: add a class for CardApplicationXSIM
......................................................................

ts_31_10x: add a class for CardApplicationXSIM

In change Id410489841bb9020ddbf74de9114d808b1d5adb6, the RuntimeState
class automatically adds additional files to the CardApplications for
ISIM and USIM. This works only once. The second time an exception will
be thrown because the added files are already in the CardApplication.
Currently there is no way generate new card applications during
initialization because the card applications are just objects that are
created once in ts_31_10x.py. Lets turn them into classes and create the
objects during initialization. This way we get fresh objects when we
re-initialize.

Change-Id: Ibb4f6242e7a92af84a905daa727b1b87016e7819
---
M pySim-shell.py
M pySim/ts_31_102.py
M pySim/ts_31_103.py
3 files changed, 8 insertions(+), 4 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/pySim-shell.py b/pySim-shell.py
index d24a881..594ad97 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -82,8 +82,8 @@
 
 	# Create runtime state with card profile
 	profile = CardProfileUICC()
-	profile.add_application(CardApplicationUSIM)
-	profile.add_application(CardApplicationISIM)
+	profile.add_application(CardApplicationUSIM())
+	profile.add_application(CardApplicationISIM())
 	rs = RuntimeState(card, profile)
 
 	# FIXME: do this dynamically
diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py
index faf0f38..14d7ec1 100644
--- a/pySim/ts_31_102.py
+++ b/pySim/ts_31_102.py
@@ -1115,4 +1115,6 @@
     }
 }
 
-CardApplicationUSIM = CardApplication('USIM', adf=ADF_USIM(), sw=sw_usim)
+class CardApplicationUSIM(CardApplication):
+    def __init__(self):
+	    super().__init__('USIM', adf=ADF_USIM(), sw=sw_usim)
diff --git a/pySim/ts_31_103.py b/pySim/ts_31_103.py
index e1f552f..63ef99e 100644
--- a/pySim/ts_31_103.py
+++ b/pySim/ts_31_103.py
@@ -223,4 +223,6 @@
     }
 }
 
-CardApplicationISIM = CardApplication('ISIM', adf=ADF_ISIM(), sw=sw_isim)
+class CardApplicationISIM(CardApplication):
+    def __init__(self):
+	    super().__init__('ISIM', adf=ADF_ISIM(), sw=sw_isim)

-- 
To view, visit https://gerrit.osmocom.org/c/pysim/+/25818
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ibb4f6242e7a92af84a905daa727b1b87016e7819
Gerrit-Change-Number: 25818
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211020/bd0948fe/attachment.htm>


More information about the gerrit-log mailing list