-
Notifications
You must be signed in to change notification settings - Fork 333
Open
Description
Modbus-Master-Slave-for-Arduino/ModbusRtu.h
Line 668 in df2fc9b
| if (i8state < 6) //7 was incorrect for functions 1 and 2 the smallest frame could be 6 bytes long |
Hi, while reading your library I have noticed that in a poll method for master module you have defined shortest possible frame as 6 bytes. What is correct but only for correct responses, for the error responses it should be 5 (including CRC).
For example error response for command 0x01 will look like:
[Address] [Function code] [exception] [CRC HI] [CRC LO]
so even though you are later validating answer to be an error in validateAnswer it will never come true since those frames are prevously eliminated due to the lenght.
Metadata
Metadata
Assignees
Labels
No labels
