Closed lutostag closed 6 years ago
Many thanks for your PR! Later this weekend I'll look into it.
Appreciate it. I know how I am planning to fix up the tests. I should be able to do so tomorrow.
Also wanted to say a big thank you for putting out this library. We use it to talk to several different pieces of hardware and it is the most non-confrontational python library for modbus.
Thanks again!
Great patch. I actually learned something new from the page you link in the docstring of recv_exactly
.
But I've some placed some comments.
Fixed the comment, if there is anything else let me know. More than happy to make any further changes needed.
Thanks for being so quick with the review. :)
I've added 2 other comments about handling expection responses. Have you seen them?
@OrangeTux, no I don't see them as comments against the diff. GitHub seems to drop them sometimes (if you comment as part of a review, but don't submit at the very bottom)
I think my comments should be visible now.
Indeed, thanks for checking that, I didn't know about the error handling.
The code is a bit more verbose now on the send_message side, but I think I made it as clear as possible. If you have a better idea on how to make it easier to read, I can take another attempt at it.
Hope that it covers your concerns.
Thanks for the eagle-eyed review!
I've merged your changes into 1.0.1. Note that 1.0.1 isn't uploaded to Pypi. I forgot to update the version number in setup.py
. Therefore I created a new release, 1.0.2, which is fixed this. 1.0.2 is on Pypi.
Again. thanks for your effort.
This should fix #49
It works by checking exactly how many bytes are expected to be returned, and waiting until we receive that many... or a timeout (where we will receive fewer bytes than requested).
This was a problem with us either on slow serial devices (when setting up the connection... parity) or tcp connections that were slow to respond (as the recv call will bail out early sometimes if there is nothing already in the buffer).
I haven't tested manually, so using your travis to see what falls out and we will fix it up.
Thanks!