-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comment clarity #66
Comments
In general:
In that particular line, the function is called to make it read (and thus flush) the data that may be still cached inside the device |
Okay, I think I understand. Every time the user's read() callback is called, even if all the Modbus packet's bytes aren't yet available in the UART's receive buffer, the user's read() callback should empty the hardware's receive buffer, discarding even incomplete Modbus packets (the hope is that the next time the poll is made, the Modbus packet will be complete and able to be used). |
The |
I see lines:
nmbs->platform.read(nmbs->msg.buf, sizeof(nmbs->msg.buf), 0, nmbs->platform.arg);
Should the user's read and write callbacks empty the
nmbs->msg.buf
and the hardware's UART buffers when the timeout parameter is zero? The comment innanomodbus.h
doesn't say to do this:The text was updated successfully, but these errors were encountered: