From 1d6ffcfad5b6f2dae8587b4b3fe96cef735f90be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Barton=C3=AD=C4=8Dek?= Date: Sat, 8 Jul 2023 15:57:57 +0200 Subject: [PATCH] Use serial.serial_for_url() to allow usage of RFC2217 serial ports --- gsmmodem/serial_comms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gsmmodem/serial_comms.py b/gsmmodem/serial_comms.py index 22e722c..9e08e61 100644 --- a/gsmmodem/serial_comms.py +++ b/gsmmodem/serial_comms.py @@ -47,8 +47,8 @@ def __init__(self, port, baudrate=115200, notifyCallbackFunc=None, fatalErrorCal def connect(self): """ Connects to the device and starts the read thread """ - self.serial = serial.Serial(dsrdtr=True, rtscts=True, port=self.port, baudrate=self.baudrate, - timeout=self.timeout,*self.com_args,**self.com_kwargs) + self.serial = serial.serial_for_url(dsrdtr=True, rtscts=True, url=self.port, baudrate=self.baudrate, + timeout=self.timeout, *self.com_args, **self.com_kwargs) # Start read thread self.alive = True self.rxThread = threading.Thread(target=self._readLoop)