-
Notifications
You must be signed in to change notification settings - Fork 943
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
Not possible to decode then encode a DiagnosticStatusResponse #1531
Comments
Our test "test_diagnostic_requests_decode" does not seem to have any problems. Why do you do both encode() and decode(), our classes are not prepared, or at least tested for that. You normally only do either decode() or encode() depending whether you want to send or receive a message. But pull requests are welcome. |
Hi Jan, |
Solved, see dev. |
Thank you very much! |
Versions
Pymodbus Specific
Description
It is not possible to decode, then encode a DiagnosticStatusResponse since self.message becomes a tuple in decode and in encode a tuple isn't handled (only list). That means the message will not be processed in encode.
Code and Logs
import pymodbus.diag_message
a = pymodbus.diag_message.DiagnosticStatusResponse()
a.decode(b"\x00\x01\x02\x03")
packet = a.encode()
print(packet)
Output: b'\x00\x01'
The text was updated successfully, but these errors were encountered: