Skip to content

Commit

Permalink
Fix typo in chunck VS chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimmyvandenbergh authored Dec 7, 2024
1 parent ca8df6c commit 4286e56
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pyvisa_py/protocols/usbtmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,13 +476,13 @@ def read(self, size):
# + 1 * wMaxPacketSize for message sizes that equals wMaxPacketSize == size + usbtmc_header_size.
# This to be able to retrieve a short package to end communication
# (see USB 2.0 Section 5.8.3 and USBTMC Section 3.3)
chunck_size = (
chunk_size = (

Check warning on line 479 in pyvisa_py/protocols/usbtmc.py

View check run for this annotation

Codecov / codecov/patch

pyvisa_py/protocols/usbtmc.py#L479

Added line #L479 was not covered by tests
math.floor(
(size + usbtmc_header_size) / self.usb_recv_ep.wMaxPacketSize
)
+ 1
) * self.usb_recv_ep.wMaxPacketSize
resp = raw_read(chunck_size)
resp = raw_read(chunk_size)

Check warning on line 485 in pyvisa_py/protocols/usbtmc.py

View check run for this annotation

Codecov / codecov/patch

pyvisa_py/protocols/usbtmc.py#L485

Added line #L485 was not covered by tests

response = BulkInMessage.from_bytes(resp)
received_transfer.extend(response.data)
Expand All @@ -507,14 +507,14 @@ def read(self, size):
# is sent (one whose length is less than wMaxPacketSize)
# wMaxPacketSize may be incorrectly reported by certain drivers.
# Therefore, continue reading until the transfer_size is reached.
chunck_size = (
chunk_size = (

Check warning on line 510 in pyvisa_py/protocols/usbtmc.py

View check run for this annotation

Codecov / codecov/patch

pyvisa_py/protocols/usbtmc.py#L510

Added line #L510 was not covered by tests
math.floor(
(size - len(received_transfer))
/ self.usb_recv_ep.wMaxPacketSize
)
+ 1
) * self.usb_recv_ep.wMaxPacketSize
resp = raw_read(chunck_size)
resp = raw_read(chunk_size)
received_transfer.extend(resp)

Check warning on line 518 in pyvisa_py/protocols/usbtmc.py

View check run for this annotation

Codecov / codecov/patch

pyvisa_py/protocols/usbtmc.py#L517-L518

Added lines #L517 - L518 were not covered by tests
if len(received_transfer) >= response.transfer_size:
eom = response.transfer_attributes & 1

Check warning on line 520 in pyvisa_py/protocols/usbtmc.py

View check run for this annotation

Codecov / codecov/patch

pyvisa_py/protocols/usbtmc.py#L520

Added line #L520 was not covered by tests
Expand Down

0 comments on commit 4286e56

Please sign in to comment.