dexter has submitted this change. (
https://gerrit.osmocom.org/c/pysim/+/25805 )
Change subject: pySim-shell: add cardinfo command
......................................................................
pySim-shell: add cardinfo command
It may sometimes be helpful to get a bit of general information about
the card. To sort out problems it sometimes helps to get an idea what
card type and ICCID pySim-shell has in memory.
Change-Id: If31ed17102dc0108e27a5eb0344aabaaf19b19f9
---
M pySim-shell.py
1 file changed, 24 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
diff --git a/pySim-shell.py b/pySim-shell.py
index ef6a2b1..d09b45a 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -731,6 +731,17 @@
else:
raise ValueError("error: cannot authenticate, no adm-pin!")
+ def do_cardinfo(self, opts):
+ """Display information about the currently inserted
card"""
+ self._cmd.poutput("Card info:")
+ self._cmd.poutput(" Name: %s" % self._cmd.card.name)
+ self._cmd.poutput(" ATR: %s" % b2h(self._cmd.card._scc.get_atr()))
+ self._cmd.poutput(" ICCID: %s" % self._cmd.iccid)
+ self._cmd.poutput(" Class-Byte: %s" % self._cmd.card._scc.cla_byte)
+ self._cmd.poutput(" Select-Ctrl: %s" % self._cmd.card._scc.sel_ctrl)
+ self._cmd.poutput(" AIDs:")
+ for a in self._cmd.rs.mf.applications:
+ self._cmd.poutput(" %s" % a)
@with_default_category('ISO7816 Commands')
class Iso7816Commands(CommandSet):
--
To view, visit
https://gerrit.osmocom.org/c/pysim/+/25805
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: If31ed17102dc0108e27a5eb0344aabaaf19b19f9
Gerrit-Change-Number: 25805
Gerrit-PatchSet: 5
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged