mcci-catena / Modbus-for-Arduino

Modbus library for Arduino
GNU Lesser General Public License v2.1
7 stars 6 forks source link

Host poll() return value is inconsistent #6

Closed terrillmoore closed 6 years ago

terrillmoore commented 6 years ago

A quick review reveals that the host poll() routine doesn't behave consistently.

Best would be to have a callback or lambda that gets called on message send completion. Right now it's pretty hard to know what happened.

https://github.com/mcci-catena/Modbus-for-Arduino/blob/30daf897feb04c3e2f6a492519d5a8cf8beb4c1f/ModbusRtu.h#L530-L544

terrillmoore commented 6 years ago

A further review showed that error / exception code handling was inconsistent. Generally speaking, errors were correctly detected, but the codes generated were inconsistent with the actual reason.

terrillmoore commented 6 years ago

Fixed by #8