Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction_id for serial == 0. #2208

Merged
merged 1 commit into from
May 30, 2024
Merged
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
5 changes: 2 additions & 3 deletions pymodbus/framer/old_framer_rtu.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def check_frame(self):
if (result := self.decoder.decode(data)) is None:
raise ModbusIOException("Unable to decode request")
result.slave_id = self._header["uid"]
result.transaction_id = self._header["tid"]
result.transaction_id = 0
self._buffer = self._buffer[self._header["len"] :]
Log.debug("Frame advanced, resetting header!!")
callback(result) # defer or push to a thread?
Expand All @@ -171,8 +171,7 @@ def buildPacket(self, message):
packet = super().buildPacket(message)

# Ensure that transaction is actually the slave id for serial comms
if message.slave_id:
message.transaction_id = message.slave_id
message.transaction_id = 0
return packet

def sendPacket(self, message):
Expand Down