mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-25 23:08:34 +03:00
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:
@@ -18,7 +18,7 @@
|
||||
|
||||
import serial
|
||||
import time
|
||||
import os.path
|
||||
import os
|
||||
import argparse
|
||||
from typing import Optional
|
||||
|
||||
@@ -33,7 +33,10 @@ class SerialSimLink(LinkBase):
|
||||
def __init__(self, device: str = '/dev/ttyUSB0', baudrate: int = 9600, rst: str = '-rts',
|
||||
debug: bool = False, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
print("Using serial reader interface")
|
||||
if os.environ.get('PYSIM_INTEGRATION_TEST') == "1":
|
||||
print("Using serial reader interface")
|
||||
else:
|
||||
print("Using serial reader interface at port %s" % device)
|
||||
if not os.path.exists(device):
|
||||
raise ValueError("device file %s does not exist -- abort" % device)
|
||||
self._sl = serial.Serial(
|
||||
|
||||
Reference in New Issue
Block a user