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
diff --git a/pySim/transport/modem_atcmd.py b/pySim/transport/modem_atcmd.py
index 9a4f0a5..88e6253 100644
--- a/pySim/transport/modem_atcmd.py
+++ b/pySim/transport/modem_atcmd.py
@@ -21,7 +21,6 @@
import time
import re
import argparse
-import os
from typing import Optional
from pySim.utils import Hexstr, ResTuple
@@ -34,16 +33,13 @@
class ModemATCommandLink(LinkBase):
"""Transport Link for 3GPP TS 27.007 compliant modems."""
+ name = "modem for Generic SIM Access (3GPP TS 27.007)"
def __init__(self, opts: argparse.Namespace = argparse.Namespace(modem_dev='/dev/ttyUSB0',
modem_baud=115200), **kwargs):
device = opts.modem_dev
baudrate = opts.modem_baud
super().__init__(**kwargs)
- if os.environ.get('PYSIM_INTEGRATION_TEST') == "1":
- print("Using modem for Generic SIM Access (3GPP TS 27.007)")
- else:
- print("Using modem for Generic SIM Access (3GPP TS 27.007) at port %s" % device)
self._sl = serial.Serial(device, baudrate, timeout=5)
self._echo = False # this will be auto-detected by _check_echo()
self._device = device