Shifting serial interface connection parts from __init__() into connect() method

This commit is contained in:
Travis-L-R
2025-11-11 19:18:00 +10:30
parent 040f332078
commit 2245ac8d97

View File

@@ -50,6 +50,11 @@ class SerialInterface(StreamInterface):
else:
self.devPath = ports[0]
StreamInterface.__init__(
self, debugOut=debugOut, noProto=noProto, connectNow=connectNow, noNodes=noNodes, timeout=timeout
)
def connect(self) -> None:
logger.debug(f"Connecting to {self.devPath}")
if sys.platform != "win32":
@@ -63,9 +68,7 @@ class SerialInterface(StreamInterface):
self.stream.flush() # type: ignore[attr-defined]
time.sleep(0.1)
StreamInterface.__init__(
self, debugOut=debugOut, noProto=noProto, connectNow=connectNow, noNodes=noNodes, timeout=timeout
)
super().connect()
def _set_hupcl_with_termios(self, f: TextIOWrapper):
"""first we need to set the HUPCL so the device will not reboot based on RTS and/or DTR