Change in pysim[master]: pySim-*.py: print info about selected reader interface

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Fri May 10 15:26:30 UTC 2019


Vadim Yanitskiy has submitted this change and it was merged. ( https://gerrit.osmocom.org/11491 )

Change subject: pySim-*.py: print info about selected reader interface
......................................................................

pySim-*.py: print info about selected reader interface

Change-Id: Idd791d7ef635e15915aab13274aefc15e70777b0
---
M pySim-prog.py
M pySim-read.py
M pysim-testdata/fakemagicsim.ok
M pysim-testdata/sysmoUSIM-SJS1.ok
M pysim-testdata/sysmosim-gr1.ok
5 files changed, 15 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Vadim Yanitskiy: Looks good to me, approved



diff --git a/pySim-prog.py b/pySim-prog.py
index d6d7ad5..2638eef 100755
--- a/pySim-prog.py
+++ b/pySim-prog.py
@@ -568,12 +568,18 @@
 
 	# Init card reader driver
 	if opts.pcsc_dev is not None:
+		print("Using PC/SC reader (dev=%d) interface"
+			% opts.pcsc_dev)
 		from pySim.transport.pcsc import PcscSimLink
 		sl = PcscSimLink(opts.pcsc_dev)
 	elif opts.osmocon_sock is not None:
+		print("Using Calypso-based (OsmocomBB, sock=%s) reader interface"
+			% opts.osmocon_sock)
 		from pySim.transport.calypso import CalypsoSimLink
 		sl = CalypsoSimLink(sock_path=opts.osmocon_sock)
 	else: # Serial reader is default
+		print("Using serial reader (port=%s, baudrate=%d) interface"
+			% (opts.device, opts.baudrate))
 		from pySim.transport.serial import SerialSimLink
 		sl = SerialSimLink(device=opts.device, baudrate=opts.baudrate)
 
diff --git a/pySim-read.py b/pySim-read.py
index d4a9849..17fce61 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -76,12 +76,18 @@
 
 	# Init card reader driver
 	if opts.pcsc_dev is not None:
+		print("Using PC/SC reader (dev=%d) interface"
+			% opts.pcsc_dev)
 		from pySim.transport.pcsc import PcscSimLink
 		sl = PcscSimLink(opts.pcsc_dev)
 	elif opts.osmocon_sock is not None:
+		print("Using Calypso-based (OsmocomBB, sock=%s) reader interface"
+			% opts.osmocon_sock)
 		from pySim.transport.calypso import CalypsoSimLink
 		sl = CalypsoSimLink(sock_path=opts.osmocon_sock)
 	else: # Serial reader is default
+		print("Using serial reader (port=%s, baudrate=%d) interface"
+			% (opts.device, opts.baudrate))
 		from pySim.transport.serial import SerialSimLink
 		sl = SerialSimLink(device=opts.device, baudrate=opts.baudrate)
 
diff --git a/pysim-testdata/fakemagicsim.ok b/pysim-testdata/fakemagicsim.ok
index 7de421d..a1d9e9c 100644
--- a/pysim-testdata/fakemagicsim.ok
+++ b/pysim-testdata/fakemagicsim.ok
@@ -1,3 +1,4 @@
+Using PC/SC reader (dev=1) interface
 Reading ...
 ICCID: 1122334455667788990
 IMSI: 001010000000102
diff --git a/pysim-testdata/sysmoUSIM-SJS1.ok b/pysim-testdata/sysmoUSIM-SJS1.ok
index 275e79e..3bbdc90 100644
--- a/pysim-testdata/sysmoUSIM-SJS1.ok
+++ b/pysim-testdata/sysmoUSIM-SJS1.ok
@@ -1,3 +1,4 @@
+Using PC/SC reader (dev=0) interface
 Reading ...
 ICCID: 1122334455667788990
 IMSI: 001010000000102
diff --git a/pysim-testdata/sysmosim-gr1.ok b/pysim-testdata/sysmosim-gr1.ok
index 6a66cda..a1a49fd 100644
--- a/pysim-testdata/sysmosim-gr1.ok
+++ b/pysim-testdata/sysmosim-gr1.ok
@@ -1,3 +1,4 @@
+Using PC/SC reader (dev=2) interface
 Reading ...
 ICCID: 1122334455667788990
 IMSI: 001010000000102

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Idd791d7ef635e15915aab13274aefc15e70777b0
Gerrit-Change-Number: 11491
Gerrit-PatchSet: 7
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Assignee: tnt <tnt at 246tNt.com>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-CC: Harald Welte <laforge at gnumonks.org>
Gerrit-CC: tnt <tnt at 246tNt.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190510/906ac6d6/attachment.html>


More information about the gerrit-log mailing list