-
Notifications
You must be signed in to change notification settings - Fork 122
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
How to specify custom response decoder? #310
Comments
Decoding of user-defined function codes (65..=72 and 100..=110) has not been implemented yet.
|
There is also a considerable amount of redundancy between the code of the mentioned functions. Could probably be rewritten in a better way. |
yes, when I return a correct number for a custom function code in get_response_pdu_len(), it goes correctly. but there's many other function codes and only the user knowns what len is expected. |
Checking the expected size only is an additional safety measure. The CRC code in the ADU serves as the sentinel. Decoding of ADU/PDU frames should be rewritten. I have vague ideas, but unfortunately no time to do this. |
it's now trying to get a valid function code (of course there won't be, since the function code is custom), and give up after 20 retries.
tokio-modbus-0.16.1\src\codec\rtu.rs 265 ---> Failed to decode response frame: Invalid function code: 0x65
Is there a way users can specify their own decoder outside?
The text was updated successfully, but these errors were encountered: