Commit 89998d4c28531fd3700754fbd0bff184615b725e
1 parent
0f28f3c3
Fix handling of invalid function code (closes #315)
Thanks to paperwork
Showing
1 changed file
with
1 additions
and
1 deletions
src/modbus.c
| ... | ... | @@ -1027,7 +1027,7 @@ int modbus_reply(modbus_t *ctx, const uint8_t *req, |
| 1027 | 1027 | |
| 1028 | 1028 | default: |
| 1029 | 1029 | rsp_length = response_exception( |
| 1030 | - ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_FUNCTION, rsp, FALSE, | |
| 1030 | + ctx, &sft, MODBUS_EXCEPTION_ILLEGAL_FUNCTION, rsp, TRUE, | |
| 1031 | 1031 | "Unknown Modbus function code: 0x%0X\n", function); |
| 1032 | 1032 | break; |
| 1033 | 1033 | } | ... | ... |