diff --git a/doc/modbus_set_debug.txt b/doc/modbus_set_debug.txt index 9e6a2e9..7621e03 100644 --- a/doc/modbus_set_debug.txt +++ b/doc/modbus_set_debug.txt @@ -8,15 +8,16 @@ modbus_set_debug - set debug flag of the context SYNOPSIS -------- -*int modbus_set_debug(modbus_t *'ctx', int 'boolean');* +*int modbus_set_debug(modbus_t *'ctx', int 'flag');* DESCRIPTION ----------- The _modbus_set_debug()_ function shall set the debug flag of the *modbus_t* -context by using the argument 'boolean'. When the 'boolean' value is set to -'TRUE', many verbose messages are displayed on stdout and stderr. For example, -this flag is useful to display the bytes of the Modbus messages. +context by using the argument 'flag'. By default, the boolean flag is set to +'FALSE'. When the 'flag' value is set to 'TRUE', many verbose messages are +displayed on stdout and stderr. For example, this flag is useful to display the +bytes of the Modbus messages. [verse] ___________________ diff --git a/src/modbus.c b/src/modbus.c index e8cf909..7dcc50e 100644 --- a/src/modbus.c +++ b/src/modbus.c @@ -1667,14 +1667,14 @@ void modbus_free(modbus_t *ctx) ctx->backend->free(ctx); } -int modbus_set_debug(modbus_t *ctx, int boolean) +int modbus_set_debug(modbus_t *ctx, int flag) { if (ctx == NULL) { errno = EINVAL; return -1; } - ctx->debug = boolean; + ctx->debug = flag; return 0; } diff --git a/src/modbus.h b/src/modbus.h index c5eb1ff..8d245a8 100644 --- a/src/modbus.h +++ b/src/modbus.h @@ -173,7 +173,7 @@ EXPORT void modbus_close(modbus_t *ctx); EXPORT void modbus_free(modbus_t *ctx); EXPORT int modbus_flush(modbus_t *ctx); -EXPORT int modbus_set_debug(modbus_t *ctx, int boolean); +EXPORT int modbus_set_debug(modbus_t *ctx, int flag); EXPORT const char *modbus_strerror(int errnum);