Skip to content

Commit

Permalink
Correct minor framer/pdu errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
janiversen committed Oct 23, 2024
1 parent 31528c1 commit 686f4fb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion pymodbus/framer/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def __init__(
) -> None:
"""Initialize a ADU (framer) instance."""
self.decoder = decoder
self.databuffer = b""

def decode(self, _data: bytes) -> tuple[int, int, int, bytes]:
"""Decode ADU.
Expand Down
4 changes: 2 additions & 2 deletions pymodbus/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ def execute(self, no_response_expected: bool, request: ModbusPDU): # noqa: C901
request.transaction_id = 0
Log.debug("Running transaction {}", request.transaction_id)
if _buffer := hexlify_packets(
self.client.framer.databuffer
self.databuffer
):
Log.debug("Clearing current Frame: - {}", _buffer)
self.client.framer.databuffer = b''
self.databuffer = b''
expected_response_length = None
if not isinstance(self.client.framer, FramerSocket):
response_pdu_size = request.get_response_pdu_size()
Expand Down
1 change: 0 additions & 1 deletion test/framer/test_framer.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,6 @@ def test_processIncomingFrame_roundtrip(self, entry, test_framer, msg, dev_id, t
assert result
assert result.slave_id == dev_id
assert result.transaction_id == tid
assert not test_framer.databuffer
expected = test_framer.encode(
result.function_code.to_bytes(1,'big') + result.encode(),
dev_id, 1)
Expand Down

0 comments on commit 686f4fb

Please sign in to comment.