We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent adc2019 commit 8ce8001Copy full SHA for 8ce8001
pymodbus/pdu/decoders.py
@@ -33,7 +33,7 @@ def lookupPduClass(self, data: bytes) -> type[ModbusPDU] | None:
33
sub_func_code = int(data[2])
34
return self.sub_lookup[func_code].get(sub_func_code, None)
35
if func_code == 0x08: # diag message, sub_function_code is 2 bytes
36
- sub_func_code = int(data[3])
+ sub_func_code = int.from_bytes(data[2:4], "big")
37
38
return self.lookup.get(func_code, None)
39
0 commit comments