diff options
authorHarald Welte <laforge@osmocom.org>2021-04-11 12:17:30 +0200
committerHarald Welte <laforge@osmocom.org>2021-04-11 12:35:25 +0200
commit84724f567c337b11df0f82a46ce660149f5c5a6b (patch)
parentc8ff026782f9f3a6b1dd2197083154916dfdea17 (diff)
init_reader: Print device name/number of chosen reader
It's sometimes not clear what automatic defaults are chosen when starting a pySim program; let's inform the user of the chosen reader. Change-Id: I87fd934243bc3556fd6db0ce6d219c22a60c2db4
1 files changed, 5 insertions, 4 deletions
diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py
index 290bc7c..64a06a5 100644
--- a/pySim/transport/__init__.py
+++ b/pySim/transport/__init__.py
@@ -182,19 +182,20 @@ def init_reader(opts, **kwargs) -> Optional[LinkBase]:
sl = None # type : :Optional[LinkBase]
if opts.pcsc_dev is not None:
- print("Using PC/SC reader interface")
+ print("Using PC/SC reader interface (dev_number=%u)" % opts.pcsc_dev)
from pySim.transport.pcsc import PcscSimLink
sl = PcscSimLink(opts.pcsc_dev, **kwargs)
elif opts.osmocon_sock is not None:
- print("Using Calypso-based (OsmocomBB) reader interface")
+ print("Using Calypso-based (OsmocomBB) reader interface (sock='%s')" % opts.osmocon_sock)
from pySim.transport.calypso import CalypsoSimLink
sl = CalypsoSimLink(sock_path=opts.osmocon_sock, **kwargs)
elif opts.modem_dev is not None:
- print("Using modem for Generic SIM Access (3GPP TS 27.007)")
+ print("Using modem for Generic SIM Access (3GPP TS 27.007) (dev='%s', baud=%u)" %
+ (opts.modem_dev, opts.modem_baud))
from pySim.transport.modem_atcmd import ModemATCommandLink
sl = ModemATCommandLink(device=opts.modem_dev, baudrate=opts.modem_baud, **kwargs)
else: # Serial reader is default
- print("Using serial reader interface")
+ print("Using serial reader interface (dev='%s', baud=%u)" % (opts.device, opts.baudrate))
from pySim.transport.serial import SerialSimLink
sl = SerialSimLink(device=opts.device, baudrate=opts.baudrate, **kwargs)
return sl