Parcourir la source

Display function codes in hexadecimal in debug mode

Stéphane Raimbault il y a 13 ans
Parent
commit
7fed3ff9b8
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  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 (ctx->debug) {
                 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]);
             }
             if (ctx->error_recovery & MODBUS_ERROR_RECOVERY_PROTOCOL) {