Commit 7fed3ff9b8a5f4e02587661cd6e059a1080af30a
1 parent
16e14ae1
Display function codes in hexadecimal in debug mode
Showing
1 changed file
with
1 additions
and
1 deletions
src/modbus.c
| @@ -507,7 +507,7 @@ static int check_confirmation(modbus_t *ctx, uint8_t *req, | @@ -507,7 +507,7 @@ static int check_confirmation(modbus_t *ctx, uint8_t *req, | ||
| 507 | if (function != req[offset]) { | 507 | if (function != req[offset]) { |
| 508 | if (ctx->debug) { | 508 | if (ctx->debug) { |
| 509 | fprintf(stderr, | 509 | fprintf(stderr, |
| 510 | - "Received function not corresponding to the request (%d != %d)\n", | 510 | + "Received function not corresponding to the requestd (0x%X != 0x%X)\n", |
| 511 | function, req[offset]); | 511 | function, req[offset]); |
| 512 | } | 512 | } |
| 513 | if (ctx->error_recovery & MODBUS_ERROR_RECOVERY_PROTOCOL) { | 513 | if (ctx->error_recovery & MODBUS_ERROR_RECOVERY_PROTOCOL) { |