Closed unreal79 closed 2 years ago
Thanks for the report and the patch. I spent some time to understand how the g_modbus_lib_received_telegram[1] **+ 0x80**
line sets the MSB but I failed to do so. Is there any reason for that line not to be g_modbus_lib_received_telegram[1] | 0x80
?
Sorry for the misleading ** part (I was trying to emphasize the +0x80
inside code section, but failed). Edited.
I see no reason not to use | 0x80
-- it's a tiny bit faster then addition.
Sorry for being unresponsive for a while. Would you like to create a PR for this fix to get credit?
No, submit the commit yourself please.
According to _Modbus_Application_Protocol_V11b3.pdf:
Currently
modbus_lib_send_error
does not comply to the Modbus standard. It is easily patchable: