transport: move init message into concrete classes
In in the module __init__.py we print an init message (which type of LinkBase class is providing the SimLink). However in __init__.py we tend to have only platform independed code but the message string can already be categorized as platform depened. Let's put the init message into the constructor of the concrete classes of LinkBase. Related: OS#6210 Change-Id: I0a6dd7deb79a5f3e42b29094a1cf2535075fa430
This commit is contained in:
@@ -297,20 +297,16 @@ def init_reader(opts, **kwargs) -> LinkBase:
|
||||
Init card reader driver
|
||||
"""
|
||||
if opts.pcsc_dev is not None:
|
||||
print("Using PC/SC reader interface")
|
||||
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")
|
||||
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)")
|
||||
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")
|
||||
from pySim.transport.serial import SerialSimLink
|
||||
sl = SerialSimLink(device=opts.device,
|
||||
baudrate=opts.baudrate, **kwargs)
|
||||
|
||||
Reference in New Issue
Block a user