diff --git a/socs/agents/cryomech_cpa/drivers.py b/socs/agents/cryomech_cpa/drivers.py index 179ee319e..8851011f5 100644 --- a/socs/agents/cryomech_cpa/drivers.py +++ b/socs/agents/cryomech_cpa/drivers.py @@ -53,7 +53,7 @@ def get_data(self): Gets the raw data from the PTC and returns it in a usable format. """ self.send(self.buildRegistersQuery()) - data = self.recv() + data = self.recv(1024) data_flag, brd = self.breakdownReplyData(data) return data_flag, brd diff --git a/socs/tcp.py b/socs/tcp.py index da5ac8e5a..3b6746d6a 100644 --- a/socs/tcp.py +++ b/socs/tcp.py @@ -123,13 +123,18 @@ def _check_ready(self): if not sel.select(self.timeout): raise ConnectionError("Socket not ready to read. Possible timeout.") - def recv(self): + def recv(self, bufsize=4096): """Receive response from the device. This method will check if the socket is ready to be read from before performing the recv. If there is no data to read, or the socket is otherwise unready an exception is raised. + Parameters + ---------- + bufsize : int + Amount of data to be recieved in bytes. Defaults to 4096. + Returns ------- ``str`` or ``bytes`` @@ -143,7 +148,7 @@ def recv(self): """ self._check_ready() - data = self.comm.recv(1024) + data = self.comm.recv(bufsize) return data def __del__(self):