From 174fd32f17b7147724933cc3d8e33ebbb9541831 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Thu, 7 Dec 2023 11:28:08 +0100 Subject: [PATCH] runtime: explain how file probing works We use a trick to probe a file (that does not exist in the local file model yet). Let's explain further how that works, in particular why we do not have to upate any state if probing fails. Change-Id: I2a8af73654251d105af8de1c17da53dfa10dc669 Related: OS#5418 --- pySim/runtime.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pySim/runtime.py b/pySim/runtime.py index 028bef13..1155433c 100644 --- a/pySim/runtime.py +++ b/pySim/runtime.py @@ -256,6 +256,12 @@ class RuntimeLchan: "Cannot select unknown file by name %s, only hexadecimal 4 digit FID is allowed" % fid) try: + # We access the card through the select_file method of the scc object. + # If we succeed, we know that the file exists on the card and we may + # proceed with creating a new CardEF object in the local file model at + # run time. In case the file does not exist on the card, we just abort. + # The state on the card (selected file/application) wont't be changed, + # so we do not have to update any state in that case. (data, sw) = self.scc.select_file(fid) except SwMatchError as swm: k = self.interpret_sw(swm.sw_actual)