demntor / pymodbus

Modbus Python release (tools included)
0 stars 0 forks source link

Improve code for calculating the RTU frame size #45

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The current version of pymodbus defines static methods for
calculating the RTU frame size for each and every kind of 
Modbus request / response. It would be better if only the
individual frame sizes / byte count positions were stored
in these classes.

I have fixed this problem on the rtu branch. The new version
moves the calculation to ModbusPDU, changes it to become
a classmethod, and adds class attributes _rtu_frame_size
or _rtu_byte_count_pos to the request and response classes.

I've also added some missing unittests.

Please have a look at the changes and commit them to the
trunk if everything is ok.

Original issue reported on code.google.com by albert.k...@gmail.com on 28 Feb 2011 at 11:49

GoogleCodeExporter commented 8 years ago
Looks good, merged to trunk.

Original comment by Bashw...@gmail.com on 28 Feb 2011 at 6:28