Browse Source

Display function codes in hexadecimal in debug mode

Stéphane Raimbault 13 years ago
parent
commit
7fed3ff9b8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/modbus.c

+ 1 - 1
src/modbus.c

@@ -507,7 +507,7 @@ static int check_confirmation(modbus_t *ctx, uint8_t *req,
         if (function != req[offset]) {
         if (function != req[offset]) {
             if (ctx->debug) {
             if (ctx->debug) {
                 fprintf(stderr,
                 fprintf(stderr,
-                        "Received function not corresponding to the request (%d != %d)\n",
+                        "Received function not corresponding to the requestd (0x%X != 0x%X)\n",
                         function, req[offset]);
                         function, req[offset]);
             }
             }
             if (ctx->error_recovery & MODBUS_ERROR_RECOVERY_PROTOCOL) {
             if (ctx->error_recovery & MODBUS_ERROR_RECOVERY_PROTOCOL) {