forked from public/pysim
transport: print reader device/number on init
When we initialize the reader, we currently tell only which type of interface we are using, but we do not print the reader number or the device path. Let's extend the messages so that the path is printed. To prevent problems with integration-tests, let's also add an environment variable that we can use to detect when pySim runs inside a integration-test. Related: OS#6210 Change-Id: Ibe296d51885b1ef5f9c9ecaf1d28da52014dcc4b
This commit is contained in:
@@ -21,6 +21,7 @@ import serial
|
||||
import time
|
||||
import re
|
||||
import argparse
|
||||
import os
|
||||
from typing import Optional
|
||||
|
||||
from pySim.utils import Hexstr, ResTuple
|
||||
@@ -36,7 +37,10 @@ class ModemATCommandLink(LinkBase):
|
||||
|
||||
def __init__(self, device: str = '/dev/ttyUSB0', baudrate: int = 115200, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
print("Using modem for Generic SIM Access (3GPP TS 27.007)")
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user