Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions pymodbus/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# pylint: disable=missing-type-doc
import struct
import time
from contextlib import suppress
from functools import partial
from threading import RLock

Expand Down Expand Up @@ -379,17 +378,6 @@ def _recv(self, expected_response_length, full): # noqa: C901
)
length = struct.unpack(">H", read_min[4:6])[0] - 1
expected_response_length = h_size + length
elif expected_response_length is None and isinstance(
self.client.framer, ModbusRtuFramer
):
with suppress(
IndexError # response length indeterminate with available bytes
):
expected_response_length = (
self.client.framer.get_expected_response_length(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I think this needs to be changed to calling these 2 methods:

pdu_class = self.decoder.lookupPduClass(func_code)
         return pdu_class.calculateRtuFrameSize(data)

I am quite sure I should not have removed it totally.

read_min
)
)
if expected_response_length is not None:
expected_response_length -= min_size
total = expected_response_length + min_size
Expand Down