diff --git a/scaaml/capture/scope/lecroy/lecroy_communication.py b/scaaml/capture/scope/lecroy/lecroy_communication.py index 80e64e22..f3497600 100644 --- a/scaaml/capture/scope/lecroy/lecroy_communication.py +++ b/scaaml/capture/scope/lecroy/lecroy_communication.py @@ -261,13 +261,15 @@ def get_waveform(self, channel: LECROY_CHANNEL_NAME_T) -> LecroyWaveform: def query_binary_values(self, message: str, datatype="B", - container=None) -> bytearray: + container=None) -> bytes: """Query binary data. Args: message (str): Query message. datatype (str): Ignored. container: A bytearray is always used. + + Returns: a bytes representation of the response. """ assert self._socket is not None @@ -282,14 +284,14 @@ def query_binary_values(self, # Receive and decode answer return self._get_raw_response() - def _format_command(self, command: str) -> bytearray: + def _format_command(self, command: str) -> bytes: """Method formatting leCroy command. Args: command (str): The command to be formatted for sending over a socket. - Returns: Bytearray representation to be directly sent over a socket. + Returns: bytes representation to be directly sent over a socket. """ # Compute header for the current command, header: # operation = DATA | EOI @@ -299,11 +301,12 @@ def _format_command(self, command: str) -> bytearray: formatted_command = command_header + command.encode("ascii") return formatted_command - def _get_raw_response(self) -> bytearray: + def _get_raw_response(self) -> bytes: """Get raw response from the socket. - Returns: bytearray representation of the response. + Returns: bytes representation of the response. """ + assert self._socket is not None response = b"" while True: