summaryrefslogtreecommitdiffstats
path: root/lab_control/connection
diff options
context:
space:
mode:
Diffstat (limited to 'lab_control/connection')
-rw-r--r--lab_control/connection/direct_connection.py6
-rw-r--r--lab_control/connection/serial_connection.py8
-rw-r--r--lab_control/connection/tcp_connection.py5
3 files changed, 5 insertions, 14 deletions
diff --git a/lab_control/connection/direct_connection.py b/lab_control/connection/direct_connection.py
index 8df1e42..0ea2ea3 100644
--- a/lab_control/connection/direct_connection.py
+++ b/lab_control/connection/direct_connection.py
@@ -12,9 +12,3 @@ class DirectConnection:
def send(self, request: str, responseExpected=True) -> str:
return self.requestHandler(request)
-
- def checkConfiguration(self) -> None:
- assert self.config.get("baudrate") == 115200
- assert self.config.get("bytesize") == 8
- assert self.config.get("stopbits") == 1
- assert self.config.get("parity") == "N"
diff --git a/lab_control/connection/serial_connection.py b/lab_control/connection/serial_connection.py
index 282494b..2e48d56 100644
--- a/lab_control/connection/serial_connection.py
+++ b/lab_control/connection/serial_connection.py
@@ -6,10 +6,10 @@ class SerialConnection:
self._port = serial.Serial(portName)
def configure(self, config: dict) -> None:
- self._port.baudrate = parameters["baudrate"]
- self._port.bytesize = parameters["bytesize"]
- self._port.stopbits = parameters["stopbits"]
- self._port.parity = parameters["parity"]
+ self._port.baudrate = config["baudrate"]
+ self._port.bytesize = config["bytesize"]
+ self._port.stopbits = config["stopbits"]
+ self._port.parity = config["parity"]
def send(self, request):
self._port.write(request.encode())
diff --git a/lab_control/connection/tcp_connection.py b/lab_control/connection/tcp_connection.py
index 6af710c..bdbf811 100644
--- a/lab_control/connection/tcp_connection.py
+++ b/lab_control/connection/tcp_connection.py
@@ -6,7 +6,7 @@ class TCPConnection:
self._socket.connect((address, port))
def configure(self, config: dict) -> None:
- self._socket.settimeout(parameters["timeout"])
+ self._socket.settimeout(config["timeout"])
def send(self, request, responseExpected=True):
self._socket.sendall(request.encode())
@@ -17,6 +17,3 @@ class TCPConnection:
except TimeoutError:
response = None
return response
-
- def checkConfiguration(self) -> None:
- pass