Skip to content

Commit

Permalink
[squash] make mypy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxrdv committed Dec 1, 2023
1 parent 8c48d62 commit 260cb93
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions scaaml/capture/scope/lecroy/lecroy_communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 260cb93

Please sign in to comment.