modbus-core icon indicating copy to clipboard operation
modbus-core copied to clipboard

Fix rtu request pdu length calculation

Open AsgerWenneb opened this issue 6 months ago • 2 comments

PR to fix the request PDU length calculation mentioned in https://github.com/slowtec/modbus-core/issues/12.

My application doesn't use coils but I've attempted to implement the fix for FC 0x0F as well. I have not looked at the TCP implementation at all (I have no experience with it). An error was also added for when the quantity and bytes fields don't match up.

AsgerWenneb avatar Aug 11 '25 09:08 AsgerWenneb

@AsgerWenneb

Currently, I have neither a device to test this nor the time to look into the specifications. would you mind to add some tests for this & rebase your branch?

flosse avatar Sep 16 '25 19:09 flosse

Sorry for the late response. The branch should be rebased on the latest changes now.

I've added some tests in the same style as existing tests.

AsgerWenneb avatar Dec 16 '25 09:12 AsgerWenneb