laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/34850?usp=email )
Change subject: pySim-shell: Include current logical channel in prompt
......................................................................
pySim-shell: Include current logical channel in prompt
Now that pySim-shell can switch between logical channels, let's state
the currently used logical channel in the prompt.
Change-Id: I45781a6fba205eeb4ac7f58d5cb642b7131bdd88
Related: OS#6230
---
M pySim-shell.py
1 file changed, 14 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/50/34850/1
diff --git a/pySim-shell.py b/pySim-shell.py
index 2f97389..022b276 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -291,7 +291,7 @@
def update_prompt(self):
if self.lchan:
path_str = self.lchan.selected_file.fully_qualified_path_str(not self.numeric_path)
- self.prompt = 'pySIM-shell (%s)> ' % (path_str)
+ self.prompt = 'pySIM-shell (%02u:%s)> ' % (self.lchan.lchan_nr, path_str)
else:
if self.card:
self.prompt = 'pySIM-shell (no card profile)> '
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34850?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: I45781a6fba205eeb4ac7f58d5cb642b7131bdd88
Gerrit-Change-Number: 34850
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/34849?usp=email )
Change subject: prevent SimCardCommands.select_adf_by_aid bypassing lchan
......................................................................
prevent SimCardCommands.select_adf_by_aid bypassing lchan
Now that pySim-shell is aware of logical channels and issues almost
all of its APDUs on the currently selected channel, we must also make
sure that ADF selection by AID (implemented by the CardBase class)
issues the SELECT on the respective logical channel.
Before this patch, SELECT ADF by AID would always be issued on the
primary logical channel (0), irrespective of the currently active
RuntimeLchan.
Change-Id: Idf05c297e6a2e24ca539408b8912e348c0782bb4
Related: OS#6230
---
M pySim/cards.py
M pySim/runtime.py
2 files changed, 26 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/49/34849/1
diff --git a/pySim/cards.py b/pySim/cards.py
index 84f53e1..a241d1c 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -146,8 +146,10 @@
return True
return False
- def select_adf_by_aid(self, adf: str = "usim") -> Tuple[Optional[Hexstr], Optional[SwHexstr]]:
+ def select_adf_by_aid(self, adf: str = "usim", scc: SimCardCommands = None) -> Tuple[Optional[Hexstr], Optional[SwHexstr]]:
"""Select ADF.U/ISIM in the Card using its full AID"""
+ # caller may pass a custom scc; we fall back to default
+ scc = scc or self._scc
if is_hex(adf):
aid = adf
else:
@@ -155,10 +157,10 @@
if aid:
aid_full = self._complete_aid(aid)
if aid_full:
- return self._scc.select_adf(aid_full)
+ return scc.select_adf(aid_full)
else:
# If we cannot get the full AID, try with short AID
- return self._scc.select_adf(aid)
+ return scc.select_adf(aid)
return (None, None)
def card_detect(scc: SimCardCommands) -> Optional[CardBase]:
diff --git a/pySim/runtime.py b/pySim/runtime.py
index 27c2ef1..a54a1b6 100644
--- a/pySim/runtime.py
+++ b/pySim/runtime.py
@@ -299,7 +299,7 @@
for p in inter_path:
try:
if isinstance(p, CardADF):
- (data, sw) = self.rs.card.select_adf_by_aid(p.aid)
+ (data, sw) = self.rs.card.select_adf_by_aid(p.aid, scc=self.scc)
self.selected_adf = p
else:
(data, sw) = self.scc.select_file(p.fid)
@@ -343,7 +343,7 @@
f = sels[name]
try:
if isinstance(f, CardADF):
- (data, sw) = self.rs.card.select_adf_by_aid(f.aid)
+ (data, sw) = self.rs.card.select_adf_by_aid(f.aid, scc=self.scc)
else:
(data, sw) = self.scc.select_file(f.fid)
self.selected_file = f
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34849?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: Idf05c297e6a2e24ca539408b8912e348c0782bb4
Gerrit-Change-Number: 34849
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
Attention is currently required from: laforge.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/34846?usp=email )
Change subject: commands.py: Add support for multiple logical channels.
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34846?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: Ibe5650dedc0f7681acf82018a86f83377ba81d30
Gerrit-Change-Number: 34846
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Sun, 22 Oct 2023 07:30:15 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: laforge.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/34845?usp=email )
Change subject: RuntimeState: Add type annotation for 'card' argument
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34845?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: I3c5138a918f7e45aabe3972883714d05ee704877
Gerrit-Change-Number: 34845
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Sun, 22 Oct 2023 07:27:57 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/34847?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: pySim-shell: Create + use per-RuntimeLchan SimCardCommands
......................................................................
pySim-shell: Create + use per-RuntimeLchan SimCardCommands
This new approach will "fork" separate SimCardCommands instances
for each RuntimeLchan. Higher-layer code should now always use the
RuntimeLchan.scc rather than the RuntimeState.card._scc in order to
make sure commands use the correct logical channel.
Change-Id: I13e2e871f2afc2460d9fd1cd566de42267c7d389
Related: OS#6230
---
M pySim-shell.py
M pySim/ara_m.py
M pySim/commands.py
M pySim/global_platform.py
M pySim/runtime.py
M pySim/ts_102_222.py
M pySim/ts_31_102.py
M pySim/ts_51_011.py
8 files changed, 60 insertions(+), 43 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/47/34847/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34847?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: I13e2e871f2afc2460d9fd1cd566de42267c7d389
Gerrit-Change-Number: 34847
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset