dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/35249?usp=email )


Change subject: runtime: explain why we may access the card object directly
......................................................................

runtime: explain why we may access the card object directly

When we are in the constructor of RuntimeState, we may/must access the
card object directly. Let's explain why, since it may not be immediately
obvious.

Change-Id: I01f74d5f021d46679d1c9fa83fb8753382b0f88f
Related: OS#5418
---
M pySim/runtime.py
1 file changed, 20 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/49/35249/1

diff --git a/pySim/runtime.py b/pySim/runtime.py
index 2447222..670babc 100644
--- a/pySim/runtime.py
+++ b/pySim/runtime.py
@@ -110,6 +110,12 @@
         # probe for those applications
         for f in sorted(set(apps_profile) - set(apps_taken), key=str):
             try:
+                # we can not use the lchan provided methods select, or 
select_file
+                # since those method work on an already finished file model. At
+                # this point we are still in the initialization process, so it 
is
+                # no problem when we access the card object directly without 
caring
+                # about updating other states. For normal selects at runtime, 
the
+                # caller must use the lchan provided methods select or 
select_file!
                 data, sw = self.card.select_adf_by_aid(f.aid)
                 self.selected_adf = f
                 if sw == "9000":

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35249?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I01f74d5f021d46679d1c9fa83fb8753382b0f88f
Gerrit-Change-Number: 35249
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pma...@sysmocom.de>
Gerrit-MessageType: newchange

Reply via email to