Skip to content

Commit a5d5332

Browse files
committed
Transaction id overrun.
1 parent b172dc0 commit a5d5332

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pymodbus/transaction.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,10 @@ def getNextTID(self):
480480
481481
:returns: The next unique transaction identifier
482482
"""
483-
self.tid = (self.tid + 1) & 0xFFFF
483+
if self.tid < 65000:
484+
self.tid += 1
485+
else:
486+
self.tid = 1
484487
return self.tid
485488

486489
def reset(self):

0 commit comments

Comments
 (0)