mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-22 13:28:33 +03:00
transport: Move printing of reader number/name to generic code
Let's avoid copy+pasting print statements everywhere. The instances do already have a __str__ method for the purpose of printing their name in a generic way. Change-Id: I663a9ea69bf7e7aaa6502896b6a71ef692f8d844
This commit is contained in:
@@ -29,14 +29,11 @@ from pySim.utils import h2b, b2h, Hexstr, ResTuple
|
||||
|
||||
class SerialSimLink(LinkBase):
|
||||
""" pySim: Transport Link for serial (RS232) based readers included with simcard"""
|
||||
name = 'Serial'
|
||||
|
||||
def __init__(self, opts = argparse.Namespace(device='/dev/ttyUSB0', baudrate=9600), rst: str = '-rts',
|
||||
debug: bool = False, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
if os.environ.get('PYSIM_INTEGRATION_TEST') == "1":
|
||||
print("Using serial reader interface")
|
||||
else:
|
||||
print("Using serial reader interface at port %s" % opts.device)
|
||||
if not os.path.exists(opts.device):
|
||||
raise ValueError("device file %s does not exist -- abort" % opts.device)
|
||||
self._sl = serial.Serial(
|
||||
|
||||
Reference in New Issue
Block a user