Skip to content

Commit c4436a1

Browse files
authored
Revert "708 Implement ReadFileRecordRequest.get_response_pdu_size() to ensure complete record (#709)"
This reverts commit 5f2cf59.
1 parent 4a7dca8 commit c4436a1

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

pymodbus/file_message.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ def __init__(self, records=None, **kwargs):
9292
"""
9393
ModbusRequest.__init__(self, **kwargs)
9494
self.records = records or []
95-
self.count = 0
9695

9796
def encode(self):
9897
"""Encode the request packet.
@@ -139,19 +138,6 @@ def execute(self, context): # NOSONAR pylint: disable=unused-argument,no-self-u
139138
files = []
140139
return ReadFileRecordResponse(files)
141140

142-
def get_response_pdu_size(self):
143-
"""Get response pdu size.
144-
145-
Func_code (1 byte) + Response Byte Count(1 byte) +
146-
N * (File Response Byte Count (1 byte) + Reference Type (1 byte) + 2 * registers to read for file record)
147-
where N = record sub-request count.
148-
"""
149-
self.count = 0
150-
for record in self.records:
151-
self.count += record.record_length * 2 + 2 if record.record_length else 0
152-
153-
return 2 + self.count
154-
155141

156142
class ReadFileRecordResponse(ModbusResponse):
157143
"""Read file record response.

0 commit comments

Comments
 (0)